Skip to content

Instantly share code, notes, and snippets.

View suda's full-sized avatar
🍃

Wojtek Siudzinski suda

🍃
View GitHub Profile
@kennwhite
kennwhite / multi_key_crypto.sh
Last active January 16, 2024 15:47
OpenSSL command line recipe for multi-public key file encryption. Any single private key paired to one of the public keys can decrypt the file.
#!/usr/bin/env bash
#
# Example of multiple key AES encryption for text files using the openssl v. 0.9.8+ command line utility
# Uses n public certs as key for MIME PKCS envelope, any individual private key can decrypt.
#
# If standard RSA ssh keys exist, these can be converted to public certs as well (and ssh keys can decrypt)
#
# To sign (and verify) the encrypted file, one of the private keys is required, see:
# http://www.openssl.org/docs/apps/smime.html#EXAMPLES for openssl smime examples
# or http://www.openssl.org/docs/apps/cms.html#EXAMPLES for cms utility (OpenSSL v. 1.0+)
@matthiasplappert
matthiasplappert / gist:9493050
Last active August 29, 2015 13:57
QuickLook Debugging for `UIView`
@interface UIView (MPAdditions)
@end
@implementation UIView (MPAdditions)
- (id)debugQuickLookObject {
if (self.bounds.size.width < 0.0f || self.bounds.size.height < 0.0f) {
return nil;
}
@ardcore
ardcore / atom-events
Last active October 13, 2021 20:35
atom.io events
application:open-your-keymap
application:open-your-stylesheet
autocomplete:attach
autoflow:reflow-paragraph
bookmarks:clear-bookmarks
bookmarks:jump-to-next-bookmark
bookmarks:jump-to-previous-bookmark
bookmarks:toggle-bookmark
bookmarks:view-all
check:correct-misspelling
@joegoggins
joegoggins / install and add gcc arm to PATH.sh
Last active December 12, 2022 06:59
How I installed GCC ARM on my Mac 10.9 Mac Book Pro
# Download the file manually from here https://launchpad.net/gcc-arm-embedded
# Note: `curl` command doesn't work
# I downloaded this one: "gcc-arm-none-eabi-4_7-2013q3-20130916-mac.tar.bz2"
# double click it to unzip it
# Make a place to install it to
mkdir /usr/local/gcc_arm
# Move the unzipped stuff there.
@dre1080
dre1080 / all2coffee.sh
Created November 9, 2013 01:25
Js2Coffee a directory recursively. Excludes node_modules, app/assets and public directories.
for FILE in `find . -name "*.js" -type f -o -path './node_modules' -prune -o -path './app/assets' -prune -o -path './public' -prune`
do
if [ -e $FILE ] ; then
COFFEE=${FILE//.js/.coffee}
echo "converting ${FILE} to ${COFFEE}"
js2coffee "$FILE" > "$COFFEE"
else
echo "File: {$1} does not exist!"
fi
@emachnic
emachnic / fstab
Created August 26, 2013 13:01
Automatically mount Apple Extreme hard drive in Raspberry PI running XBian using fstab.
#/etc/fstab
//10.0.1.1/My\040Passport\040for\040Mac /media/Passport cifs rw,username=xbian,pass=********,sec=ntlm 0 0
@jgoodall
jgoodall / README.md
Last active September 19, 2023 18:06
This is a sample of how to send some information to logstash via the TCP input from node.js or python.

This is a sample of how to send some information to logstash via the TCP input in nodejs or python. It assumes the logstash host is on 10.10.10.100 and the TCP listening input is 9563.

The logstash.conf should look something like the sample file.

The log message should be a stringified JSON object with the log message in the @message field.

To use, run the node script node sendMessageToLogstash.js, or the python script python sendMessageToLogstash.js

@aras-p
aras-p / preprocessor_fun.h
Last active April 12, 2024 17:24
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@davisford
davisford / setup-avahi.sh
Created July 12, 2013 14:14
Setup avahi-daemon on Ubuntu for so you can reach hostname `ubuntu.local` from host OS
sudo apt-get install avahi-daemon avahi-discover avahi-utils libnss-mdns mdns-scan
#!/usr/bin/env knife exec
# A knife exec script to change chef node's name, preserving all the attributes.
#
# Usage: knife exec rename-node.rb old-name new-name
#
# Script retrieves the Node object, changes its 'name' attribute,
# creates new Node object with updated name and rest of attributes
# untouched. Then it deletes old Node and Client objects from
# database, and logs into the server to update it: