Skip to content

Instantly share code, notes, and snippets.

View SkaTeMasTer's full-sized avatar

$hawn Reimerdes SkaTeMasTer

View GitHub Profile
@SkaTeMasTer
SkaTeMasTer / pushbullet-login.sh
Created February 7, 2017 08:25
Set permissions to allow it to execute: sudo chmod 777 piip.sh Open the crontab: sudo crontab -e Then paste at the bottom of the crontab: @reboot /home/pi/piip.sh
#!/bin/bash
ipVar=$(/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
curl https://api.pushbullet.com/v2/pushes \
-u <paste_your_API_key_here>: \
-d device_iden="<device_ID_of_your_phone>" \
-d type="note" \
-d title="Pi IP address" \
-d body=$ipVar \
-X POST
@SkaTeMasTer
SkaTeMasTer / static-ip-process-new-rpi
Last active February 13, 2017 08:04
RASPBERRY PI -- NEW METHOD of Setting up a static IP in latest Raspbian. he Raspbian released in May 2015 changed the way networking (and particularly WiFi) works. This applies to the current Foundation releases of Raspbian Jessie and the last Raspbian Wheezy 2015-05-05 (no longer available). This makes all the existing tutorials obsolete.
As of say mid 2015, the introduction of "Wheezy", changed the WiFi settings and obsolessioned all the "HOW TO STATIC IP" articles.
This is how to get a static IP on your RPI.
*** Note: dhcpcd (DHCP client daemon) is not the same as dhcpd (DHCP (server) daemon). ***
https://wiki.archlinux.org/index.php/dhcpcd
Considerations:
@SkaTeMasTer
SkaTeMasTer / opennic
Created February 12, 2017 05:39
Open NIC Project -- get local DNS Servers -- https://www.opennicproject.org/nearest-servers/
output:
Home › Your nearest OpenNIC DNS servers
Your nearest OpenNIC DNS servers
Are…
45.56.117.118 (ns6.ga.us) -- 99.42% uptime
138.197.25.214 (ns10.ny.us) -- 94.79% uptime
96.90.175.167 (ns4.co.us) -- 98.10% uptime
87.98.175.85 (ns10.fr) -- 98.75% uptime
@SkaTeMasTer
SkaTeMasTer / pi-hole-debug.txt
Created February 13, 2017 06:31
This is the status required for pihole to work. You need to install dependencies and hack some.
IP Addresses of this Pi:
127.0.0.1
10.124.161.101
Gateway check:
ok
#######################################
######## Whitelist Comparison #########
#######################################
@SkaTeMasTer
SkaTeMasTer / log-rotate
Created February 13, 2017 08:51
Log rotate is important to keep the SD cards on Raspberry pi from corruption, disable any logging when possible (after debugging)
Logfile RoATING file operations using UNIX logrotate utility.
=============================================
+ Rotate the log file when file size reaches a specific size
+ Continue to write the log information to the newly created file after rotating the old log file
+ Compress the rotated log files
+ Specify compression option for the rotated log files
+ Rotate the old log files with the date in the filename
+ Execute custom shell scripts immediately after log rotation
+ Remove older rotated log files
@SkaTeMasTer
SkaTeMasTer / multi-tail.sh
Created February 13, 2017 09:24
Script tails all logs from RPi
apt-get install multitail
multitail /var/log/syslog /var/log/auth.log
+ display log files in colors,
+ scroll back in a log file,
+ search inside log file,
+ merge mutliple log files effectively
@SkaTeMasTer
SkaTeMasTer / fstab
Created February 13, 2017 09:39
NFS Mounting of Synology NAS drive
192.168.1.40:/volume1/BackupPi /media/nas-backup nfs defaults,x-systemd.automount 0 0
@SkaTeMasTer
SkaTeMasTer / lighttpd.conf
Created February 14, 2017 13:21
PIHOLE config for lighthttpd
# sudo nano /etc/lighttpd/lighttpd.conf
server.modules = (
"mod_access",
"mod_accesslog",
"mod_expire",
"mod_compress",
"mod_redirect",
"mod_setenv",
"mod_rewrite"
@SkaTeMasTer
SkaTeMasTer / tcpdumping-pihole
Last active February 14, 2017 14:14
Debugging PiHOLE w/TCPDUMP
# install utils
sudo apt-get -y install libpcap0.8 tcpdump
# watch port 53 (DNS) with a specific client
sudo tcpdump -npi eth0 -vvv host 192.168.1.9 and port 53
@SkaTeMasTer
SkaTeMasTer / gist:4ddff8c2bc68c20c18a0ea28d3657fd1
Created February 20, 2017 02:08
Crazy way to "initalize" Amazon Lightsail server password. You must issue the followin commands to confirm SSH certs and allow access to apps like Wordpress and mySQL
Note: The default username for WordPress application is 'user'.
To retrieve the password for user you need to SSH the server and type
cat bitnami_application_password