RPi Setup

Expand the file system, enable SSH, change the username and password

sudo raspi-config

Upgrade the OS

sudo apt-get update

Install tmux

instructions here

START tmux

Upgrade the OS

sudo apt-get dist-update

Upgrade any installed binaries

sudo apt-get upgrade

Cleanup after the upgrade

sudo apt-get auto remove
sudo apt-get clean

Download and install dot files

git clone https://github.com/laughingMan/dotfiles.git

Install vim

sudo apt-get install vim

Install fail2ban

instructions here

Setup logrotate

instructions here

Setup MOTD

instructions here

Update hosts file

sudo vim /etc/hosts

Set a static IP address

instructions here

Setup WIFI

instructions here

Setup SSH keys

instructions here

Setup hostname

instructions here
sudo echo 'computer_name' >/etc/hostname

Install PiHole

instructions here

Jan 16

Setup SSH

Generate a new SSH key
ssh-keygen -t rsa -b 4096 -C "sprinklers_pi"

Update your computer to use the new one

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa

View your new public key
cat /home/pi/.ssh/id_rsa.pub

Add it to authorized key file of other computers to allow this computer password-less SSH access
vim ~/.ssh/authorized_keys

Jan 16

Install tmux

Install the dependencies
sudo apt-get install libevent-dev libncurses5-dev

Download the latest version of the source code here
wget "https://github.com/tmux/tmux/releases/download/2.3/tmux-2.3.tar.gz"

Unpack the download
tar xvfz tmux-2.3.tar.gz

Move to that directory and compile the source code

cd tmux-2.3/
./configure && make

Install the compiled code
sudo make install

Create a configuration file for later configuration and use it as the config file

touch ~/.tmux.conf
tmux source-file ~/.tmux.conf

Jan 16

Use PiHole to resolve local DNS

dnsmasq will read any file in dnsmasq.d as a configuration file; this is how Pi-hole works too. The file (02-mydns.conf) you’ve added tells dnsmasq where to find another hosts file (hosts.mydomain).

This will survive installs and updates by the Pi-Hole curl script. Anytime you update your hosts.mydomain file you will need to restart dnsmasq for changes to take effect. You can name the hosts file and the conf file to whatever you’d like.


Use PiHole to resolve local DNS

Create a new hosts file
sudo nano /etc/hosts.mydomain

Add IP addresses followed by the local hostname you’d like to resolve, one per line. Write out and exit. sprinklers server

Create a new dnsmasq conf file
sudo nano /etc/dnsmasq.d/02-mydns.conf

Add one line of code to the file
addn-hosts=/etc/hosts.mydomain Write out and exit.

Restart dnsmasq
sudo service dnsmasq restart


Borrowed from here. Thank you.

Jan 16

Backup the Android apps

These are commands and locations of the things I care about backing up on my phone.


abd pull /storage/emulated/0/FuelLog .
abd pull /storage/emulated/0/data

Jan 16

Manually Flash Android OS

Download the image to flash.
Nexus/ Pixel – https://developers.google.com/android/images

Unpack the zip file and you are left with a bunch of files.

Install adb and fastboot
brew install android-platform-tools

Put your phone into fastboot mode by pressing and holding the buttons
Vol Down + Power

If you want to unlock the bootloader to allow for custom recovery images, now is the time to do so
fastboot oem unlock

Now time to wipe the devices:

fastboot erase boot
fastboot erase cache
fastboot erase recovery
fastboot erase system

NOTE: For the remainder of this, you will need to be in the same directory as the Android image you just unpacked
Flash the bootloader and reboot the device

fastboot flash bootloader "name of bootloader"
fastboot reboot-bootloader

Flash the radio and reboot the device

fastboot flash radio "name of radio"
fastboot reboot-bootloader

Now you can either update the rest in one command
fastboot -w update "name of zip file"

OR you can do it all piecemeal

fastboot flash system system.img
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash cache cache.img

If you are going complete stock

fastboot erase userdata
fastboot flash userdata userdata.img

Now reboot to finish
fastboot reboot

Thanks to jhawkkw for the help

Jan 16

Setup Pihole

Run this command:
curl -L install.pi-hole.net | bash

Setup router to point to Pi-Hole for DNS

Edit the /etc/hosts file to add all computers to it for convenience

Setup DNSCrypt
instructions here

Jan 16

How to Set a Static IP Address

Find and edit the interfaces file
sudo vim /etc/network/interfaces

Find the block of code that look like this and replace it with the IP addresses that fit your network.

face eth0 inet static

May 03

Rom Switching Checklist

  • backup applications and data (TitaniumBackup)
  • create flashable TitaniumBackup zip file (TitaniumBackup)
  • backup all photos (dropbox)
  • backup rom (TWRP)
  • transfer rom backup to computer (ADB)

Dec 13

Boot into graphical mode on Kali

Find out what level you are currently running on
who -r

Find the name of the service manager currently running
chkconfig --list | grep '2:on'

If gdm3 is not installed/ used, install it
sudo apt-get install gdm3

If chkconfig is not installed, install it
apt-get install chkconfig

Turn ON the service to auto boot to GUI
chkconfig --level 2 gdm3 on

Turn OFF the service to auto boot to GUI
chkconfig --level 2 gdm3 OFF

Start GUI mode from command line

Older posts «