How to create a new user on Linux with the command line.

This simple command-line will create a new user on Linux named test5. ┌──[[email protected]]─[~] └──╼ ╼ $ sudo useradd test5 -m -K PASS_MAX_DAYS=5 -K PASS_WARN_AGE=3 -K LOGIN_RETRIES=1┌──[[email protected]]─[~] └──╼ ╼ $ sudo useradd test5 -m -K PASS_MAX_DAYS=5 -K PASS_WARN_AGE=3 -K LOGIN_RETRIES=1 Then set a password for the new user. ┌──[[email protected]]─[~] └──╼ ╼ $ sudo passwd test5 New … Read more

How to create a file named . on Linux easily. This is a very devious trick.

It is apparently possible to create a file named ., this will make the file unusable, but it is still very cool. I used this simple command. strace touch ‘.​’strace touch ‘.​’ Type a dot character “.”, then press Control-Shift-u and type 200b and then press ENTER, this will create a zero-width invisible character. Then … Read more

How to create a temporary ram drive on a Linux box. This is very useful.

Creating a ram drive on a Linux box is very useful for storing files in a temporary fashion, and having some very fast scratch space for an application. The ramfs filesystem type may be used, but it will continue to grow until your RAM is used up. The tmpfs filesystem type, does not have this … Read more

How to create a keyboard map in the .Xmodmap file.

Creating a .Xmodmap file for Linux is very easy. This file contains all of the keyboard mappings for the keyboard keys for your system. jason@darknet:~$ xmodmap -pke > ~/.Xmodmapjason@darknet:~$ xmodmap -pke > ~/.Xmodmap Now use less to view the completed file. jason@darknet:~$ cat .Xmodmapjason@darknet:~$ cat .Xmodmap This file can be edited if you wish to … Read more

How to create an ISO image of a directory with the command line.

Creating an ISO image of a directory is useful sometimes. This command will create an ISO image of a directory, ready to burn to a CD or DVD. jason@darknet:~$ genisoimage -l -V hi -r ~/Downloads/stuff > cdrom.isojason@darknet:~$ genisoimage -l -V hi -r ~/Downloads/stuff > cdrom.iso Here is example usage, creating an ISO of a directory … Read more

A simple shell script to create a new Linux user account.

This simple script will help create new user accounts on a Linux system. This is very useful when administering a Linux machine and it is necessary to create a few user accounts. #!/bin/bash   clear   trap "" SIGHUP SIGINT SIGTERM SIGTSTP   # Get username, check if its taken, and if it is the … Read more

How to install Windows 7 in a qemu KVM virtual machine and enjoy a fast Windows desktop in a window.

The qemu KVM hypervisor allows a Linux user to install a virtualized operating system that will run very fast indeed once installed. To install the qemu KVM hypervisor; enter this command. sudo apt-get install qemu-kvm qemu-utilssudo apt-get install qemu-kvm qemu-utils Then create a raw disk image to house your Windows operating system. qemu-img create -f … Read more

Using the tar command on Linux to uncompress tar.gz files with the command line.

The tar command on Linux is very useful for uncompressing files on your Linux machine. The most used command on a Linux system is uncompressing files that you have downloaded from an Internet source. The tar -xvf command will uncompress a tar.gz file. ~$ tar -xvf myfile.tar.gz~$ tar -xvf myfile.tar.gz To uncompress a tar.bz2 file … Read more