CentOS Linux or Ubuntu Linux – Get List of ip addresses on Server | Here’s a quick one-liner to spit out all ip addresses from ifconfig:
Use du to show directory sizes only
Use du to show directory sizes only | du can show directory sizes only. This is helpful to get a quick glance at what directories are taking up space. Here’s the command I like to use: $ du -sh * Here is what it looks like in action from /var on one of my servers: stmiller@li166-66:/var$ sudo du -sh * 38M backups 48M
Encode or Decode base64 from the Command Line
Encode or Decode base64 from the Command Line | If you have ever needed to quickly decode or encode base64, Linux has a command line utility called base64 that works great. I’ll show you how it works! To encode text to base64, use the following syntax: $ echo ‘scottlinux.com rocks’ | base64 c2NvdHRsaW51eC5jb20gcm9ja3MK To decode, use base64 -d. To decode base64, use a syntax
Combine apt-get update and apt-get upgrade in one command
Combine apt-get update and apt-get upgrade in one command | On Ubuntu or Debian, it is possible to make a small bash one-liner to fully update the host with one simple command. I’ll show you how! 1. Create a file called ‘update’ in /usr/local/bin: $ sudo nano /usr/local/bin/update 2. Type the following for the file contents, then save with Control+X. #!/bin/bash sudo apt-get update &&
cURL Ignore SSL Certificate Warnings
cURL Ignore SSL Certificate Warnings | To ignore any ssl certificate warnings with curl, use the tack k option. Here is an example: $ curl -k https://scottlinux.com $ curl -I -k https://scottlinux.com HTTP/1.1 200 OK Date: Tue, 14 Feb 2012 20:00:03 GMT Server: Apache Strict-Transport-Security: max-age=43200; includeSubDomains X-Frame-Options: SAMEORIGIN Set-Cookie: bb2_screener_=1329249603+66.202.152.198; path=/ X-Pingback: http://scottlinux.com/xmlrpc.php Set-Cookie: PHPSESSID=lq5dpvfagbdstib7nlg2b8a0m7; path=/ X-Hello: Hello There Vary:
This account is currently not available
This account is currently not available | This account is currently not available If you get this message attempting to ssh in or su’ing as another user, there is no valid shell set for this user. You can quickly inspect this by looking at the /etc/passwd file. Check for an entry that has something like ‘/bin/false’ or ‘/bin/nologin’ for the shell: userdude:x:111:113::/home/userdude:/bin/false
Quick Intro to zsh: auto complete
Quick Intro to zsh: auto complete | zsh or the z shell is an interactive shell that builds upon features of other shells such as bash, ksh, and tcsh. zsh is great for advanced script monkeys but also is an excellent simple bash replacement for the regular joe user. Here is a quick intro to the auto complete features of zsh! On
Create Animated GIF in Linux from Command Line
Create Animated GIF in Linux from Command Line | Imagemagick can easily make an animated gif from existing images with a simple command. I’ll show you how! First, install imagemagick: $ sudo apt-get install imagemagick Next, gather all of your .jpg images together in a single folder or directory. If needed, date/name files in a numbered or sequential order. The manor in which they
/usr/bin/mint-fortune: line 35: [: ==: unary operator expected
/usr/bin/mint-fortune: line 35: [: ==: unary operator expected | In Linux Mint Debian Edition, a recent update made the fortune script stop working. I’ll show you how to fix it! 1. Open this file with nano, or your favorite editor: sudo nano /usr/bin/mint-fortune 2. Locate line 35 which looks like this: if [ $showfortunes == "true" ]; then (Tip: in nano, press Control+C to
Bash Tips – Return to Previous Location
Bash Tips – Return to Previous Location | Ok this is a quick one, but useful! To return to the previous working directory, simply type: cd – and hit enter. Cool!




