Skip to content

Instantly share code, notes, and snippets.

View SkaTeMasTer's full-sized avatar

$hawn Reimerdes SkaTeMasTer

View GitHub Profile
@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 / 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 / pihole-display-lcd
Created January 18, 2017 01:13
Displays Pi-hole stats on the Adafruit PiTFT 2.8" touch screen # Set the pi user to log in automatically and run this script from /etc/profile # (c) 2015 by Jacob Salmela # This file is part of Pi-hole.
#!/usr/bin/env bash
# Displays Pi-hole stats on the Adafruit PiTFT 2.8" touch screen
# Set the pi user to log in automatically and run this script from /etc/profile
# (c) 2015 by Jacob Salmela
# This file is part of Pi-hole.
#
# Pi-hole is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
@SkaTeMasTer
SkaTeMasTer / top-25-ssh-commands-tricks
Created January 18, 2017 00:32
25 Best SSH Commands / Tricks
1) Copy ssh keys to user@host to enable password-less ssh logins.
ssh-copy-id user@host
To generate the keys use the command ssh-keygen
2) Start a tunnel from some machine’s port 80 to your local post 2001
ssh -N -L2001:localhost:80 somemachine
@SkaTeMasTer
SkaTeMasTer / gist:affba7514d17b237c36253e276f89131
Created January 17, 2017 23:17
connect to best network.. he priority in this file determines to which network you will connect if more then 2 configured networks are available. This will always be the network with the highest priority. WPA start script Create the WPA startup script /etc/init.d/wpa.sh
The priority in this file determines to which network you will connect if more then 2 configured networks are available. This will always be the network with the highest priority.
WPA start script
Create the WPA startup script /etc/init.d/wpa.sh
sudo vi /etc/init.d/wpa.sh
#!/bin/bash
@SkaTeMasTer
SkaTeMasTer / PiCamera-to-VideoTimelapse.sh
Created January 13, 2017 09:03
Python script to capture the time lapse images:
#do apt-get install ffmpeg Then, use this
import time
import picamera
VIDEO_DAYS = 1
@SkaTeMasTer
SkaTeMasTer / google-header-page-schema.org.txt
Created October 31, 2016 19:16
The very latest head meta tags Google
<!doctype html>
<html itemscope itemtype="http://schema.org/WebPage">
<head>
<meta charset=utf-8>
<!-- Place this data between the <head> tags of your website -->
<title>feedly. Read more, know more.</title>
<meta name="description" content="feedly: organize, read and share what matters to you." />
<link rel="mask-icon" href="//s3.feedly.com/img/feedly-icon.svg" color="#2bb24c">
@SkaTeMasTer
SkaTeMasTer / blah.sh
Created October 26, 2016 05:34
raspberry pi PIXEL desktop mod chromium
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install -y rpi-chromium-mods
sudo apt-get install -y python-sense-emu python3-sense-emu
sudo apt-get install -y python-sense-emu-doc realvnc-vnc-viewer
#! /usr/bin/python
# Written by Dan Mandle http://dan.mandle.me September 2012
# License: GPL 2.0
import os
from gps import *
from time import *
import time
import threading
#!/bin/bash
# time stamp this shit yo
nowdate=$(date "+%d-%m-%y")
nowtime=$(date "+%H:%M:%S")
# stole this idea of using gpspipe, grep and awk from here: http://thomasloughlin.com/gpspipe-gps-client/
gpsdata=$(gpspipe -w -n 10 | grep -m 1 lon)
lat=$(echo "$gpsdata" | jsawk ‘return this.lat’)
lon=$(echo "$gpsdata" | jsawk ‘return this.lon’)
gpsspeed=$(echo "$gpsdata" | jsawk ‘return this.speed’)
# runs my modified the speedtest-cli python script and uses tr instead of grep to remove some line feeds and change it to a comma to suit the csv