Skip to content

Instantly share code, notes, and snippets.

View patchbin.c
/* patchbin.c, Patch a binary file, by Lionello Lunesu, placed in the public domain */
struct FILE;
extern struct FILE* fopen(char*, char*);
extern int fwrite(void*, int, int, struct FILE*);
extern int fread(void*, int, int, struct FILE*);
extern int fseek(struct FILE*, long int, int);
#define SEEK_SET 0
extern int memcmp(void*, void*, int);
int main(int argc, char** argv)
philips / user-data
Last active Sep 16, 2020
Running consul on top of CoreOS utilizing etcd for automatic bootstrapping.
View user-data
source /etc/environment
name=$(cat /etc/machine-id)
if [ ! -f /opt/consul ]; then
mkdir /opt
mkdir /var/lib/consul
curl | lzcat > /opt/consul
chmod +x /opt/consul
samsondav / gist:a47c687b665c51844708
Last active Aug 29, 2015
Asynchronously handle tweet queue for twitter-streaming-client
View gist:a47c687b665c51844708
;; create the client with a twitter.api streaming method
(def stream (twitter-client/create-twitter-stream twitter.api.streaming/statuses-filter
:oauth-creds twitter-creds
:params {:follow user-id}))
(defn create-tweet-entities [twitter-tweet]
; the entirety of this method should be wrapped in a database transaction
(insert stream-tweets
(values (twitter-tweet-to-stream-tweet twitter-tweet))))
Luzifer /
Last active Aug 25, 2019
Strategies for persistent data storage on CoreOS-cluster

Persistent data storage on CoreOS-cluster

Storing the data on the host machine

Data directories are created in /home/coreos and mounted into the container using volume cli options of docker run. All data the container writes is stored on the host and as long as the host persists safe against container restarts / recreates.

  • Pro
    • No effort, just create the directories and mount them into the container
  • Contra
    • Container is bound to host (unable to failover)
kgorskowski / coreos-efs-cloud-config
Created Jul 10, 2015
coreos cloud-config file for dynamically mount aws efs in the right availability zone
View coreos-efs-cloud-config
- path: /etc/conf.d/nfs
permissions: '0644'
content: |
- name: XYZ
ctrl-freak /
Last active Nov 21, 2021
Retrieve APK from Non-Rooted Android Device through ADB

None of these suggestions worked for me, because Android was appending a sequence number to the package name to produce the final APK file name (this may vary with the version of Android OS). The following sequence of commands is what worked for me on a non-rooted device:

  1. Determine the package name of the app, e.g. com.example.someapp. Skip this step if you already know the package name.

    adb shell pm list packages

    Look through the list of package names and try to find a match between the app in question and the package name. This is usually easy, but note that the package name can be completely unrelated to the app name. If you can't recognize the app from the list of package names, try finding the app in Google Play using a browser. The URL for an app in Google Play contains the package name.

# Updated by Derek "Cyph3r"
# Syntax ./ <URL>
# get id and key from url
id=`echo $url | awk -F '!' '{print $2}'`
key=`echo $url | awk -F '!' '{print $3}' | sed -e 's/-/+/g' -e 's/_/\//g' -e 's/,//g'`
# decode key
williballenthin / capstone-test.clj
Last active Jul 29, 2017
demo of using capstone from clojure
View capstone-test.clj
(ns capstone-clj.core-test
(:require [clojure.test :refer :all])
(:import [capstone.Capstone]))
(deftest basic-capstone
this is the example from:
(testing "basic capstone"
Jared-Sprague / gist:7dddad2027f1b9a0cc0c2685189ae4aa
Created Oct 28, 2017
Fedora install dependencies for ios-webkit-debug-proxy
View gist:7dddad2027f1b9a0cc0c2685189ae4aa
# The instructions for ios-webkit-debug-proxy are for ubuntu, here are the packages for fedora.
dnf install autoconf automake libusb-devel libusbx-devel libplist-devel libplist-devel usbmuxd libtool libimobiledevice-devel
Arno0x / shellcode.xlsm
Last active Nov 26, 2021
XLM (Excel 4.0 macro) to execute a shellcode into Excel (32 bits) - French Macro code
View shellcode.xlsm
1. Open Excel
2. Click on the active tab
3. Select "Insérer"
4. Click on "Macro MS Excel 4.0".
5. This will create a new worksheet called "Macro1"
In the Macro1 worksheet, paste the following block in cells in column A, starting in cell A1: