Skip to content

Instantly share code, notes, and snippets.

/* 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
philips / user-data
Last active September 16, 2020 14:19
Running consul on top of CoreOS utilizing etcd for automatic bootstrapping.
#!/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
@samsondav
samsondav / gist:a47c687b665c51844708
Last active August 29, 2015 14:11
Asynchronously handle tweet queue for twitter-streaming-client
;; 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
Luzifer / README.md
Last active August 25, 2019 12:34
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
kgorskowski / coreos-efs-cloud-config
Created July 10, 2015 10:37
coreos cloud-config file for dynamically mount aws efs in the right availability zone
#cloud-config
write-files:
- path: /etc/conf.d/nfs
permissions: '0644'
content: |
OPTS_RPC_MOUNTD=""
users:
- name: XYZ
groups:
@ctrl-freak
ctrl-freak / android-adb-pull-apk.md
Last active April 9, 2024 11:31
Retrieve APK from Non-Rooted Android Device through ADB

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.

@williballenthin
williballenthin / capstone-test.clj
Last active July 29, 2017 03:25
demo of using capstone from clojure
(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"
@Jared-Sprague
Jared-Sprague / gist:7dddad2027f1b9a0cc0c2685189ae4aa
Created October 28, 2017 02:41
Fedora install dependencies for ios-webkit-debug-proxy
# 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
@Arno0x
Arno0x / shellcode.xlsm
Last active May 13, 2023 23:22
XLM (Excel 4.0 macro) to execute a shellcode into Excel (32 bits) - French Macro code
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: