Skip to content

Instantly share code, notes, and snippets.

💭
Hacking!

Robbie random-robbie

💭
Hacking!
Block or report user

Report or block random-robbie

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Bash tweet
#! /bin/bash
# tweet
#
# This script sends tweets
# Use:
# tweet "String to be tweeted"
# Special characters may not be used if your string is not delimited by quotes
#
# Author: San Bergmans
@random-robbie
random-robbie / zpanel
Created Sep 11, 2013
Zpanel Install ubuntu 12.04 X64
View zpanel
sudo apt-get update
sudo apt-get install curl -y
cd
wget http://www.zvps.co.uk/downloads/ubuntu/10-1-0/installer-10-1-0-ubuntu-64.sh.x.tar.gz
tar xzvf installer-10-1-0-ubuntu-*
sudo ./installer-10-1-0-ubuntu-*
View ubuntu-configure-sendmail-with-gmail
#!/bin/bash
HOST=$(hostname)
function install_postfix() {
echo | sudo debconf-set-selections <<__EOF
postfix postfix/root_address string
postfix postfix/rfc1035_violation boolean false
postfix postfix/mydomain_warning boolean
postfix postfix/mynetworks string 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
@random-robbie
random-robbie / Remove Zero Bytes
Created Oct 1, 2014
PHP - Remove 0kb files from folder and put text file with removed file's in.
View Remove Zero Bytes
<?php
$fol = "/var/www/zerobytes/test/";
if ($handle = opendir($fol)) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != ".." && $entry != "removed.txt" && $entry != is_dir("".$fol."".$entry."")) {
//Check filesize
if(filesize("".$fol."".$entry."") < '1000'){
$myfile = fopen("".$fol."removed.txt", "a") or die("Unable to open file!");
$txt = "$entry\r\n";
@random-robbie
random-robbie / gist:4cec8056815362550726
Created Oct 8, 2014
Scan all folders and sub-directories and print to output file.
View gist:4cec8056815362550726
import os, time, glob, fnmatch
maindir = "THE FOLDER YOU WISH TO SCAN"
def scanfolder():
os.chdir(maindir)
for name in glob.glob('*/*.pdf'):
fo = open("Output.txt", "wb")
print name
fo.write(name + "\n")
@random-robbie
random-robbie / gist:4cc88f810969f75dcdce
Last active Aug 29, 2015
Shairport install in full!
View gist:4cc88f810969f75dcdce
sudo sudo apt-get update
sudo apt-get install netatalk hfsutils hfsprogs git lxmusic xmms2 xmms2-plugin-all volumeicon-alsa mpg123 mplayer git mpd mpc flac hfsutils hfsprogs libssl-dev libavahi-client-dev libasound2-dev libao-dev libssl-dev libcrypt-openssl-rsa-perl libio-socket-inet6-perl libwww-perl avahi-utils libmodule-build-perl -y
sudo git clone https://github.com/njh/perl-net-sdp.git perl-net-sdp
cd perl-net-sdp
sudo perl Build.PL
sudo ./Build
sudo ./Build test
sudo ./Build install
cd ..
sudo git clone https://github.com/abrasive/shairport.git
View gist:b7e3a4f2ad4b040dbad3
sudo apt-get install hostapd udhcpd -y
nano /etc/udhcpd.conf
insert in to:
start 10.0.2.1 # This is the range of IPs that the hostspot will give to client devices.
end 10.0.2.100
interface wlan0
remaining yes
View gist:8c1c16ad01b0be104b90
#!/bin/bash
wget https://gist.githubusercontent.com/txt3rob/4cc88f810969f75dcdce/raw/758f5e04b21042b3c698bc5affb9101e7fd861e3/gistfile1.txt -O shairport.sh
chmod 777 shairport.sh
sudo shairport.sh
View backup
#!/bin/bash
################################################
#
# Backup all MySQL databases in separate files and compress those and also rsync a directory so all scripts are backed up
# Furthermore the script will create a folder with the current time stamp
# @author: Per Lasse Baasch (http://skycube.net) - Original Author
# @author: Robert Wiggins - Altered to include rysnc and removed timestamp from mysql-backup file names
# NOTE: MySQL and gzip installed on the system
# and you will need write permissions in the directory where you executing this script
# You will also need to run ssh-copy-id to the server you are backing up so that you do not need a password to do the backup.
View gist:b96406721a7f6bd2ed84
$date = "2015-05-31";
$d=strtotime($date);
$newdate = date('d-m-Y',$d);
You can’t perform that action at this time.