if you need to change your previous directory rapidly you can add – (dash) to your cd command and no more arguments.
if you were in:
and now in:
you can easily go back to /etc/apt/sources.list.d/ with the command
You’ve downloaded Ubuntu ISO from a mirror and want to test or install it to your computer. There are many ways to do this but I’ll share my method which requires no additional tools or software in this post. Additionally you can use this method in order to create bootable USBs for other ISOs if your ISO is hybrid image.
Unlike other methods my method does not require other tools or software to create that bootable USB, in fact it only uses dd command that is standard in Linux.
After 12.04 (I guess) all Ubuntu ISOs are hybrid ISO. This means when you dd the ISO directly to USB device then your USB will be bootable already. That’s that much easy.
But there is an important point in that process. dd command may be destructive if your destination device is not correct. So to ensure the device you double check your destination with the commands:
whichever gives you the precise information that you make sure it is the correct device.
After this short information I’ll give command to create (prepare) bootable USB below:
dd if=<iso-file> of=<destination-device> oflag=direct bs=8M
in that command if is the hybrid iso (remember your ISO files are already hybrid for the releases after 12.04).
of is the output device. Note that it is the device not the partition. For example it will be: /dev/sdb is an device and if it is your destination device it is a valid entry. But /dev/sdb1 is a partition and even /dev/sdb is your destination device giving /dev/sdb1 for of parameter will not create a bootable USB because /dev/sdb1 is a partition. So this parameter has to be device not partition.
oflag ensures caching of block device is turned of while executing dd.
bs is the block size and 8M is a fairly good parameter for the command.
For an example, if your device is /dev/sdb and you’re creating a bootable USB from ubuntu-16.04.1-desktop-amd64.iso then your command would be:
dd if=ubuntu-16.04.1-desktop-amd64.iso of=/dev/sdb oflag=direct bs=8M
Note that you may need to use sudo with that command.
If you do not have screen off function keys in your keyboard then you can use following commands to turn your screen off.
First you need to find out your screen identifier:
$ xrandr --listmonitors
0: +*LVDS1 1600/310x900/174+0+0 LVDS1
Then turn screen off with the following cmd:
xrandr --output LVDS1 --off
This will totally turn your screen off.
You know how to install deb packages with apt-get cmd. But sometimes you need to find the package provides a specific file or executable.
RedHat or CentOS users have this command by default via yum cmd.
yum whatprovides updatedb
This command outputs all packages provide updatedb file (in that case it is an executable). Continue reading
I’m very forgetful these days. Even though I could not remember what I ate yesterday or what I wore, I have password protected everything. As a result, most of the times I have ended up with a locked zip, tar.gz or other file. Yesterday I had same experience and I decided to write a brute force python application to crack my password protected file.
Unfortunately I knew that it would take time for the app to crack with brute force technique, but I could use some tricks to improve performance. For instance I can limit the alphabet to attack (most of you use same pattern, special characters, password scheme for encryption) which would save time significantly.
I should mention about a tool that deserves to be described specifically – rsync.
This tool is well known by system administrators but not as much by home users. But this tool has promising capabilities for them as well. If you’re a backup lover like me (your photos, documents and etc.) and if you’re doing a copy&paste for that, rsync is a life saver.
rsync simply synchronizes your destination directory to be same as your source directory. It does this process with very effective way. It calculates differences and only copies/synchronizes the differences of files and related directories. The destination can be a remote machine (i.e. remote_user@remote_ip:/destination/directory/path). So I backup my home folders contents with my external HDD with:
rsync -avz source-dir destination-dir
Do not use copy&paste (including console cp commands) for backup purposes. Use rsync.
Ok, even though this can be done with many other methods, I’ll explain mine. I’ll also provide youtube videos for the procedure and demonstration as well.
Unlike offline backups, online backups require minimalist suspend – save – resume actions (hopefully within small amount of time – which depends your modifications and RAM usage) while taking the snapshot. The requirement for this suspend has similar reasons to live migration –state is hold and saved then it continues to execute.
As described in our offline backups post, we could take internal or external backups. But in this post we’ll discuss external backups particularly to take backups.
Nested virtualization is very important feature if you’re using virtual machines for your daily tasks. If you’ve heard but not know much about it this blog post is for you.
You’ve probably watched the movie “Inception”. In this movie you dream in an other dream. This is a nested dream. Virtualization can also be nested like this. You have virtual machine but within the virtual machine you may have another virtual machine. This is not an easy thing (just like dream) since your CPU architecture and hypervisor must support this feature.
So we need to check 2 important features first:
- Does the CPU supports nested virtualization
- Does the Hypervisor supports nested virtualization
If you recently updated your Centos VM you may started getting the error below:
Kernel panic -- not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
unknown-block may change depending on your configuration, but symptoms stay same: Kernel panic after the update, and this error message.
yum remove kernel
That fixed my problem. Hopefully it fixes yours.
When you put your computer to suspend, it will turn some of its devices to power saving mode to preserve energy consumption. But computers have many sleep states from deeper to shallow just like humans. The most shallow one is the freeze (or S0-idle) which only puts CPU to idle and if possible turn other devices to less power consuming mode. The most deeper one is the “Sleep-to-Memory” (or S3) in which CPU is turned off, and nearly only memory and some critical devices uses energy. It is also possible to suspend-to-disk (S4, S5), with STD current state of computer saved to disk. STD is called hibernate. In hibernate cold reboot will be performed so, it will take longer to restore the state.