VirtualBox does not offer anything for this task -- you need to do it yourself. It's not that hard:
fdisk
, dd
and gParted
.sudo su
fdisk -l
to see the disk information. \When you do a bitwise copy using the dd
tool you will not see any output until it completes or an error occurs.
However, you can send a command signal to the process to have it show its progress so far.
From another terminal, simply call (be root or use sudo
):
pkill -USR1 dd
This makes dd
write something like this into the terminal it is running in:
388+0 records in
387+0 records out
396288000 bytes (396 MB) copied, 24.9862s, 15.9 MB/s
cpulimit is a simple program which attempts to limit the cpu usage of a process (expressed in percentage, not in cpu time). This is useful to control batch jobs, when you don't want them to eat too much cpu. It does not act on the nice value or other scheduling priority stuff, but on the real cpu usage. Also, it is able to adapt itself to the overall system load, dynamically and quickly.
If you are exchanging files with a client via Dropbox you do not need to access the Web page every time you want to fetch files. Instead, you can fully integrate your Dropbox account(s) into nautilus (Gnome's file manager) with automatic synchronization.
.deb
file for your system architecture (32 or 64 bit) from the Linux download page.If you want to have an English Ubuntu UI, but still see dates, money amounts, paper formats, etc. in German formats, you can fine-tune your /etc/default/locale
like this:
LANG="en_US.UTF-8"
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
Make sure you have both en...
In shell scripts you can use $1
to refer to the first argument, $2
for the second, etc. If you want to refer to all arguments (e.g. when writing a bash script that takes an arbitrary amount of arguments and passes them on to another call), you may not want to do a “$1 $2 $3 $4 ...
”.
Use $@
instead, like in this script:
$ cat welcome
#!/bin/bash
echo Hello to $@
When called, the above would produce this:
$ ./welcome the world and universe
Hello to the world and universe
Note that $@
works for both sh
and `ba...
This is somewhat similar to the touch
command of Linux:
FileUtils.touch 'example.txt', :mtime => Time.now - 2.hours
If you omit the :mtime
the modification timestamp will be set to the current time:
FileUtils.touch 'example.txt'
You may also pass an array of filenames:
FileUtils.touch %w[ foo bar baz ], :mtime => Time.now - 2.hours
Non-existent files will be created.
If you need Google Chrome to run in English, and your system locale is a non-English one, you have two options:
/opt/google/chrome/locales/
and remove any .pak
files except those starting with “en
”. They reappear when Chrome gets updated.This may help you running your Selenium tests using the Chrome driver on applications that choose the language from what the browser sends as preferred language (which Chrome guesses from your system locale).
You know there is the du
command to fetch the disk usage of a directory (“.
” in this example). By default, output is sorted by directory name, not size:
du -h --max-depth=1 .
40K ./a
2.3G ./b
3.1M ./c
500M ./d
2.8G .
To see which directories take up the most (or least) space you can order them by size like this (the -h
switch does the magic of understanding humanized size formats):
du -h --max-depth=1 . | sort -h
40K ./a
3.1M ./c
500M ./d
2.3G ./b
2.8G .
Note that you will need to...
If you want to enforce soft tabs (spaces instead of tabstops) in Vim put this into your ~/.vimrc
(Linux) or C:\Users\<Username>\_vimrc
(Windows):
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
You can also call those commands in a running Vim instance (using ":set ...
") to switch on soft tabs temporarily.
On a side note: remember the :mkvimrc
command that saves active settings to a vimrc file.
You probably already manage servers you often connect to inside the ~/.ssh/config
file. What is nice: you may define alias names for hosts so that you can say something like ssh foobar-staging
.
This is especially helpful for servers whose hostnames are hard to remember or who don't have a DNS record at all (and must be accessed via their IP address).
To achieve the above, you can define something like this in your ~/.ssh/config
:
Host foobar-staging
Hostname staging.example.com
Note that SSH will only match this for `ssh f...
One of the more controversial changes in the Ubuntu 10.04 beta is the Mac OS-inspired change to have window buttons on the left side. We’ll show you how to move the buttons back to the right.
Or run this via console:
gconftool-2 --set /apps/metacity/general/button_layout \
--type string "menu:minimize,maximize,close"
When you simply want to get to know Puppet, follow puppetlabs’ Learning Puppet Docs. They give you a handy introduction inside a virtual machine they provide. You can watch the talk by Garrett Honeycutt 'Expanded Introduction to Puppet'.
Do not miss their cheatsheat and their [learn-puppet virtual machine](http://info.puppetl...
Reading a URL via GET:
curl http://example.com/
Defining any HTTP method (like POST or PUT):
curl http://example.com/users/1 -XPUT
Sending data with a request:
curl http://example.com/users -d"first_name=Bruce&last_name=Wayne"
If you use -d
and do not set an HTTP request method it automatically defaults to POST.
Performing basic authentication:
curl http://user:password@example.com/users/1
All together now:
curl http://user:password@example.com/users/1 -XPUT -d"screen_name=batman"
...
When installing RMagick you may get an error messages like this:
Version 2.13.1:
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 2.13.1. Can't find Magick-config in /home/arne/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/var/lib/gems/1.8/bin
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
d...
If you want to manually check if e-mail delivery works on a machine by sending an e-mail you can run the following:
mail -s Test someone@example.com < /dev/null
This will send an empty e-mail with "Test" as its subject to someone@example.com
.
If you want it to contain a message body, call mail -s Test someone@example.com
only; the mail
application will then read your input from stdin. Finish your message by sending EOT with Ctrl-D -- if you are asked for anything else ...
blueprint is DevStructure’s workhorse tool that looks inside popular package managers, finds changes you made to configuration files, and archives software you built from source to generate Puppet, Chef, or shell code. Everything blueprint sees is stored in Git to be diffed and pushed. It runs on Ubuntu Linux 10.04 and newer.
My T410 has a NVIDIA graphics card (NVS 3100M).
My BIOS configuration looks like this:
My X crashed when trying to activate both Dell U2410 monitors connected using DVI to the docking station.
The solution was to disable DDC/CI on the monitors: Menu -> Other settings -> DDC/CI disable
Note that you shouldn't disable DDC/CI if you don't have any issues with your displays.
Although you can access many symbols using the AltGr key you may be missing some, like the en-dash (–) or em-dash (—). You can use a compose key for them instead.
First, make sure you have a compose key configured.
I suggest using the "Menu" key which is located between the right Meta and Ctrl key.
Control Center → Keyboard → Layout → Options → Position of Compos...
This note is a reminder that there is something called AppArmor that could cause weird errors ("File not found", "Can't open file or directory", ...) after configuration changes, e.g. when changing MySQL's data directory.
Remember to have a look at AppArmor's daemon configuration (usually at /etc/apparmor.d/
) if you change daemon configuration and run into errors such as the one above.
Using OpenSSL it's very easy to seriously encrypt files.
Use the script below. Input / Output are self explanatory. Put a long passphrase into PASSWORD_FILENAME. It is the key to decrypt to file again. Paste this into a console and copy it to wherever you need it.
touch /tmp/openssl_encryption_password && chmod 0700 /tmp/openssl_encryption_password && apg -n1 -m 60 > /tmp/openssl_encryption_password
Remember to at least delete the input file afterwards. Better use [shred to wipe files on Linux](https://makandracards.com/makandra/1013-s...
When you delete a file with rm
it's still possible to recover the file or parts of it. Use shred
to overwrite the content of a file and delete it afterwards.
shred -u $file
Be aware that this is not sufficient for flash memory, like SSDs or USB pen drives. The write will possibly target another memory area than where the file was located previously. Prefer disk encryption whenever possible.
To erase complete directory structures, using shred
is cumbersome. Use wipe
instead:
wipe -...
Sometimes you want to run a command forever, e.g. to compile a haml to html file on the console. Use this:
$ while(true) do haml index.haml index.html; sleep 1.5; done