Find where an executable is on your Linux system.

Finding the location of an installed program can be annoying. But this is how to find where a program is. The whereis(1) command will print out the installed locations of various programs. darkstar:~/Documents> whereis tcsh tcsh: /usr/bin/tcsh /bin/tcsh /usr/share/man/man1/tcsh.1.gzdarkstar:~/Documents> whereis tcsh tcsh: /usr/bin/tcsh /bin/tcsh /usr/share/man/man1/tcsh.1.gz The find command will also allow you to locate an … Read more

How to fork off a process from a program in C. Simple netcat example.

This post will explain how to fork() off a daemon process from a program in C. This is good if you wish to run a process on a machine after the program has finished and you have been returned to the command prompt. The sample program below uses the int daemon(int nochdir, int noclose); function … Read more

Debian 8 still stores WIFI passwords in plain text.

The /etc/NetworkManager/system-connections directory in Debian and Ubuntu stores files that are named after the WIFI networks you have connected to. These contain the passwords for the wireless networks that your machine has connected to. Here is a sample file. [connection] id=detportal uuid=539c7711-95ba-4f0a-8797-33d32ec779d7 type=802-11-wireless   [802-11-wireless] ssid=detportal mode=infrastructure security=802-11-wireless-security   [802-11-wireless-security] key-mgmt=wpa-psk psk=detportal   [ipv4] method=auto … Read more

Get hardware information with the Linux command line on Debian.

The hwinfo command for Linux will allow the user to get hardware information from the command line. Type sudo apt-get install hwinfo to install this command. It will be installed in the /sbin directory and therefore, you will need superuser privileges to execute this command and get the hardware information. jason@darkstar:~$ sudo apt-get install hwinfojason@darkstar:~$ … Read more

Useful Linux weblinks. Very interesting information.

https://www.cs.cmu.edu/~gilpin/tutorial/. Debugging Under Unix: gdb Tutorial. http://docs.kali.org/general-use/starting-metasploit-framework-in-kali. Setting up the Metasploit framework in Kali Linux. http://www.backtrack-linux.org/forums/showthread.php?t=8154. Using the netdiscover command on Linux to scan for hosts on a network. https://insights.ubuntu.com/2014/10/10/watch-netflix-in-ubuntu-today/. Watch Netflix on Ubuntu with the Google Chrome browser and ditch Windows on your media center machine. http://www.linuxquestions.org/questions/programming-9/how-can-i-list-directories-only-in-linux-375219/. How to list only directories when using … Read more

How to search for files on a Windows machine with the command line. And some other useful tricks.

This command will search a directory recursively to find files matching a pattern. C:\Users\Homer>where /R C:\Users\homer\Documents *.txt C:\Users\Homer\Documents\age-of-ultron-script-outline.txt C:\Users\Homer\Documents\windows10key.txt C:\Users\Homer\Documents\Downloads\Linux The Complete Manual 2nd Edition (TRUE PDF)\Torrent downloaded from AhaShare.com.txt C:\Users\Homer\Documents\Downloads\Linux The Complete Manual 2nd Edition (TRUE PDF)\Torrent Downloaded From ExtraTorrent.cc.txt C:\Users\Homer\Documents\Downloads\Linux The Complete Manual 2nd Edition (TRUE PDF)\tracked_by_h33t_com.txt C:\Users\Homer\Documents\Downloads\Linux The Complete Manual 2nd Edition … Read more

How to get information out of the system logfiles on Linux. Showing failed logins.

There are a few ways to get information out of the /var/log files using the Linux command line. Here are a few examples. Show the history of apt commands on your Linux box with this command. jason@eyjafjallajkull:~$ grep ‘Commandline: ‘ /var/log/apt/history.log Commandline: apt-get upgrade Commandline: apt-get install gnome-alsamixer Commandline: apt-get install indicator-sound-switcher Commandline: apt-get upgrade … Read more

Use the netdiscover command to find hosts on your local LAN.

The netdiscover utility will list all connected hosts on your local LAN. This is useful for scanning a network and determining which hosts are online. I used this command to scan an IP range starting with 192.168.0.1. jason@darkstar:~$ sudo netdiscover -r 192.168.0.1/24jason@darkstar:~$ sudo netdiscover -r 192.168.0.1/24 Currently scanning: Finished! | Screen View: Unique Hosts   … Read more

How to convert a Wikipedia article to a text file using the Linux command line.

The wikipedia2text command allows a command line user on Debian to output the contents of a Wikipedia article to a text file on your hard drive. Install this command this way: jason@darkstar:~/Documents$ sudo apt-get install wikipedia2textjason@darkstar:~/Documents$ sudo apt-get install wikipedia2text Then convert an article this way. jason@darkstar:~/Documents$ wikipedia2text Debian > Debian.txtjason@darkstar:~/Documents$ wikipedia2text Debian > Debian.txt … Read more

List files by modification date with the ls command on Linux.

This one-liner will list all files in a directory by modification time, newest first. jason@eyjafjallajkull:~/Pictures$ ls -thuljason@eyjafjallajkull:~/Pictures$ ls -thul Use it this way to list the top 20 files listed. jason@eyjafjallajkull:/var/log$ ls -thul | head -n 20 total 6.9M -rw-rw-r– 1 root utmp 9.0K Jul 9 11:30 wtmp -rw-r–r– 1 root root 85K Jul 9 … Read more

Get the internet facing IP address of a Linux machine easily.

This simple command will print out the Internet facing IP address of a Linux machine in no time. curl ifconfig.me/ipcurl ifconfig.me/ip This will return the useragent that is used to access this URL. ubuntu ~ $ curl ifconfig.me/ua curl/7.35.0ubuntu ~ $ curl ifconfig.me/ua curl/7.35.0 Use this string to get all information about the host that … Read more

Install updates and install software on Fedora 22 Linux.

The new dnf command for Fedora 22 replaces the old yum command. But this new utility is still easy to use. To install all pending updates for Fedora 22, use this command. [root@localhost homer]# dnf update[root@localhost homer]# dnf update Use the dnf install command to install software. [root@localhost homer]# dnf install vim mc Last metadata … Read more

Add BASH styled line editing and persistent history to the CMD window.

This useful utility: http://mridgers.github.io/clink/. Will allow persistent history and line editing in the Windows 10 CMD window. This makes the CMD session much more enjoyable to use. Press Alt-H in the CMD window to get help that shows the keyboard shortcuts for this addon. Microsoft Windows [Version 10.0.10130] (c) 2015 Microsoft Corporation. All rights reserved. … Read more