Skip to content

Instantly share code, notes, and snippets.

@headdetect
headdetect / https-tls.sh
Created January 19, 2022 20:44
iptables output packet is using TLS
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
# Okay this is pretty complicated as fuk
#
# To sum it up, we're using the u32 module for iptables
# to read bytes from the payload.
#
# We want to verify that the payload of the TCP packet is of the TLS variety. If not, drop.
@headdetect
headdetect / unpack-and-install.sh
Last active June 29, 2019 21:53
My lil deploy script that I sometimes use for laravel projects
#!/bin/bash
# The file structure works like so:
# /var/www/html -> /var/www/versions/my-current-version/ (link to the current version)
# /var/www/packs (full of zipped up source files)
# /var/www/versions (unzipped source files. Compilation and asset transpilation happens here too)
# You upload (via scp or however) a zipped package of source
# code (using git archive or something) to server:/var/www/packs/date.zip
#!/bin/bash
cd /Library/Preferences
sudo rm com.sophos.sav.plist

cd /Library/Application\ Support/Sophos/cloud/Installer.app/Contents/MacOS/tools/
sudo ./InstallationDeployer —force_remove
@headdetect
headdetect / gist:7fed3950107dcf4efb8e43af83002f2a
Last active September 14, 2017 02:09
GDB Aliases and shortcuts
alias -a di = disas
define stepd
si
di
end
alias -a sd = stepd
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApplication1
{
class Program
{
private const int MissPenelty = 18;
@headdetect
headdetect / assignment_0.js
Created September 2, 2016 02:36
ASM -> JS
var s0 = 181818; // The student ID //
var t1 = 8;
var t2 = 1;
var t3 = 0;
var t4 = s0 + t1;
t3 = t3 - t2;
s0 = s0 + s0; // s0 *= 2;
@headdetect
headdetect / install_mongo_php_driver.sh
Last active November 18, 2015 20:42
Install PHP Mongo Driver
#!/bin/bash
pecl install mongo
echo "extension=mongo.so" >> /etc/php5/fpm/php.ini
echo "extension=mongo.so" >> /etc/php5/cli/php.ini
service php5-fpm restart
@headdetect
headdetect / install_mongo.sh
Created November 18, 2015 20:15
Install MongoDB 3.0.7 on Ubuntu 14.04
#!/bin/bash
echo '-----------------------------------'
echo '---- Mongo 3.0 on Ubuntu 14.04 ----'
echo '----------- Run as Sudo -----------'
echo '-----------------------------------'
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.0.list
@headdetect
headdetect / find.js
Created September 20, 2015 01:39
Forgot Playstation Account Birthdate
var querystring = require('querystring');
var http = require('http');
var fs = require('fs');
var sleep = require('sleep');
var needle = require('needle');
// Replace with own data //
// The blah_token is a hidden field in the page. View source and search for it. It changes everytime you try to submit a request. //
var blah_token = '';
@headdetect
headdetect / MakeGraph.php
Created June 23, 2015 07:47
Used to show that whole chunk requests take less time than paginated ones.
/*
* Ignore the awful looking code. This was made at 2 AM and I'm super tired.
*/
$podio = Podio::get_from_cache($this->user_id);
$app_id = 0; // Snipped //
function microtime_float()
{