Skip to content

Instantly share code, notes, and snippets.

View wesinator's full-sized avatar

Wes wesinator

View GitHub Profile
# To Compile
javac -cp /path/to/libs:/more/libs *.java
# To run
java -cp /path/to/libs:/path/to/classes MyApp
@maximevalette
maximevalette / gist:3307568
Created August 9, 2012 20:01
Supprimer .DS_Store
find . -name .DS_Store -type f -exec rm -v {} \;
@steeve85
steeve85 / decode_apt1.py
Created March 31, 2013 19:51
xor algo used in an APT1 sample
#!/usr/bin/python
# encoded data
encoded = []
encoded.append([0x2D, 0xC8, 0xD4, 0xDD, 0xCF, 0xCC, 0xDA, 0xC9, 0xDE, 0xC7, 0xD6, 0xF2, 0xF8, 0xE9, 0xF4, 0xE8, 0xF4, 0xFD, 0xEF, 0xC7, 0xCC, 0xF2, 0xF5, 0xFF, 0xF4, 0xEC, 0xE8, 0xC7, 0xD8, 0xEE, 0xE9, 0xE9, 0xFE, 0xF5, 0xEF, 0xCD, 0xFE, 0xE9, 0xE8, 0xF2, 0xF4, 0xF5, 0xC7, 0xC9, 0xEE, 0xF5, 0xB6, 0x00])
encoded.append([0x08, 0x21, 0x0F, 0x39, 0x1C, 0x08, 0x0D, 0x18, 0x09, 0x64, 0x00])
encoded.append([0x26, 0xB2, 0xAE, 0xAE, 0xAA, 0xE0, 0xF5, 0xF5, 0xE8, 0xEB, 0xEC, 0xF4, 0xEB, 0xEF, 0xF4, 0xE8, 0xEB, 0xEA, 0xF4, 0xEC, 0xE2, 0xF5, 0xEB, 0xE3, 0xED, 0xF4, 0xEB, 0xF4, 0xEB, 0xEC, 0xF4, 0xE9, 0x85, 0xED, 0xF4, 0xB2, 0xAE, 0xB7, 0xB6, 0xFC, 0x0, 0x0])
encoded.append([0x32, 0x3D, 0x1F, 0x0A, 0x19, 0x1C, 0x1C, 0x11, 0x5F, 0x44, 0x5E, 0x40, 0x50, 0x58, 0x13, 0x1F, 0x1D, 0x00, 0x11, 0x04, 0x19, 0x12, 0x1C, 0x15, 0x4B, 0x50, 0x3D, 0x23, 0x39, 0x35, 0x50, 0x46, 0x5E, 0x40, 0x4B, 0x50, 0x27, 0x19, 0x1E, 0x14, 0x1F, 0x07, 0x03, 0x50, 0x3E, 0x24, 0x50, 0x45, 0x5E, 0x41, 0x59,
@xixitalk
xixitalk / updateDDNS.sh
Created May 29, 2013 11:34
update 3322.org DDNS with API
#!/bin/sh
if [ ! -e /tmp/dnsip.txt ] ; then
ping mydomain.f3322.org -c1 | grep PING | awk '{ print $3 }' | sed 's/[()]//g' > /tmp/dnsip.txt
fi
mydnsip=$(head -1 /tmp/dnsip.txt)
curl -s http://icanhazip.com > /tmp/ip.txt
myip=$(head -1 /tmp/ip.txt)
@BartlomiejSkwira
BartlomiejSkwira / git_config.sh
Created September 3, 2013 08:27
git config
git config --global core.editor "vim"
@MichaelPaulukonis
MichaelPaulukonis / linkify.js
Created October 10, 2013 14:04
simple linkify (from MS Visual Studio upgrade report). See also: http://benalman.com/code/projects/javascript-linkify/examples/linkify/
// Linkifies the specified text content, replaces candidate links with html links
function linkify(text)
{
if(!text || 0 === text.length)
{
return text;
}
// Find http, https and ftp links and replace them with hyper links
var urlLink = /(http|https|ftp)\:\/\/[a-zA-Z0-9\-\.]+(:[a-zA-Z0-9]*)?\/?([a-zA-Z0-9\-\._\?\,\/\\\+&%\$#\=~;\{\}])*/gi;
@wiesson
wiesson / pool.py
Last active January 4, 2019 18:58
Load *.eml files from a folder Usage: python sendmails.py --start path/to/
from multiprocessing import Pool
import os, sys
import email, smtplib
storage_folder = "data/export"
mail_server = 'server-address'
mail_username = 'mail-user'
mail_password = 'mail-password'
/// <summary>
/// Converts Unix time to a regular DateTime.
/// </summary>
/// <param name="unixTime"></param>
/// <returns></returns>
public static DateTime ConvertUnixTimestamp(double unixTime)
{
DateTime stdDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0);
stdDateTime = stdDateTime.AddMilliseconds(unixTime).ToLocalTime();
return stdDateTime;
@vivianspencer
vivianspencer / file_mods.sh
Last active May 15, 2018 01:02
Recursively chmod only files
find . -type f -exec chmod 644 {} \;
@rnarian
rnarian / upstream.md
Last active July 20, 2018 17:50
fetch upstream

Add upstream repo:

git remote add upstream git://github.com/user/repo.git

Fetch upstream:

git fetch origin -v; git fetch upstream -v; git merge upstream/master