Skip to content

Instantly share code, notes, and snippets.

@samsondav
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))))
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)
View mega.sh
#!/bin/bash
# Updated by Derek "Cyph3r"
# Syntax ./mega.sh <URL>
url=$1
# 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
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:
http://www.capstone-engine.org/lang_java.html
"
(testing "basic capstone"
@kgorskowski
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
#cloud-config
write-files:
- path: /etc/conf.d/nfs
permissions: '0644'
content: |
OPTS_RPC_MOUNTD=""
users:
- name: XYZ
groups:
@Luzifer
Luzifer / README.md
Last active Aug 25, 2019
Strategies for persistent data storage on CoreOS-cluster
View README.md

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)
@Jared-Sprague
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.
# https://github.com/google/ios-webkit-debug-proxy
dnf install autoconf automake libusb-devel libusbx-devel libplist-devel libplist-devel usbmuxd libtool libimobiledevice-devel
@philips
philips / user-data
Last active Sep 16, 2020
Running consul on top of CoreOS utilizing etcd for automatic bootstrapping.
View user-data
#!/bin/bash
source /etc/environment
name=$(cat /etc/machine-id)
if [ ! -f /opt/consul ]; then
mkdir /opt
mkdir /var/lib/consul
curl http://storage.googleapis.com/ifup-org-tilde/consul-0.2.0-linux-x86-64.lzma | lzcat > /opt/consul
chmod +x /opt/consul
@ctrl-freak
ctrl-freak / android-adb-pull-apk.md
Last active Nov 21, 2021
Retrieve APK from Non-Rooted Android Device through ADB
View android-adb-pull-apk.md

https://stackoverflow.com/a/18003462/348146

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.

@Arno0x
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
BEWARE: THIS WILL ONLY WORK IN A FRENCH VERSION OF MS-OFFICE/EXCEL
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: