This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
wget https://gist.githubusercontent.com/txt3rob/4cc88f810969f75dcdce/raw/758f5e04b21042b3c698bc5affb9101e7fd861e3/gistfile1.txt -O shairport.sh | |
chmod 777 shairport.sh | |
sudo shairport.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$date = "2015-05-31"; | |
$d=strtotime($date); | |
$newdate = date('d-m-Y',$d); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$ran = rand(1,10); | |
if ($ran < 5) { | |
$host = '10.0.0.2'; | |
$backup = '10.0.0.3:3306'; | |
} else { | |
$host = '10.0.0.3:3306'; | |
$backup = '10.0.0.2:3306'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Defining the basic scraping function | |
function scrape_between($data, $start, $end){ | |
$data = stristr($data, $start); // Stripping all data from before $start | |
$data = substr($data, strlen($start)); // Stripping $start | |
$stop = stripos($data, $end); // Getting the position of the $end of the data to scrape | |
$data = substr($data, 0, $stop); // Stripping all data from after and including the $end of the data to scrape | |
return $data; // Returning the scraped data from the function | |
} |
OlderNewer