Skip to content

Instantly share code, notes, and snippets.

@csturtz
csturtz / ubuntu-v12.04.5_node-latest.sh
Created February 23, 2015 06:17
Ubuntu 12.04.5 - install latest node
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=$HOME/local
make install
@h4cc
h4cc / restart_graylog2_services.sh
Created May 1, 2014 10:48
Commands needed to stop and restart all services in a Graylog2 server.
# Stop all services in needed order.
service graylog2-web stop; service graylog2-server stop; service elasticsearch stop; service mongodb stop;
# Start all services in needed order.
# - sleep is needed, so ES and Mongo have time to startup.
service elasticsearch start; service mongodb start; sleep 5; service graylog2-server start; service graylog2-web start;
@hofmannsven
hofmannsven / README.md
Last active May 3, 2024 15:30
Git CLI Cheatsheet
@Sloy
Sloy / AutoSummaryListPreference
Created June 29, 2013 13:16
Android custom ListPreference which shows its selected value as summary, as suggested in the official guidelines. No need to use OnPreferenceChangeListener in the Activity or anything like that. Only assign entries and entryValues.
package com.your.package;
import android.content.Context;
import android.preference.ListPreference;
import android.util.AttributeSet;
/**
* Created by Rafa Vázquez on 29/06/13.
*
* ListPreference item that shows its selected value as summary.
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@joshdholtz
joshdholtz / SomeFragment.java
Last active December 22, 2022 09:41
Android Google Maps V2 - MapView in XML
public class SomeFragment extends Fragment {
MapView mapView;
GoogleMap map;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.some_layout, container, false);
@Tapchicoma
Tapchicoma / java-package-rename.sh
Created December 28, 2012 08:43
Rename java package name in command line
#!/bin/sh
find . -name *.java -print | xargs sed -i 's/old\.package\.name/new\.package\.name/g'
@crazybyte
crazybyte / encrypt_openssl.txt
Created November 25, 2012 10:10
File encryption using OpenSSL
For symmetic encryption, you can use the following:
To encrypt:
openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt
To decrypt:
openssl aes-256-cbc -salt -a -d -in encrypted.txt -out plaintext.txt
For Asymmetric encryption you must first generate your private key and extract the public key.
@pwenzel
pwenzel / internet_radio_stream_aliases.sh
Created October 23, 2012 15:16
Internet Radio Streams Via Command Line
# 1. Install mplayer command line (via Brew, Macports, or APT)
# 2. Add the following aliases to ~/.profile
# 3. Type `source ~/.profile`
# 3. Type `news` or `current` to listen in your terminal
alias news="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/news.pls" # MPR News
alias current="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/the_current.pls" # The Current
alias classical="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/classical.pls" # Classical MPR
alias localcurrent="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/local.pls" # Local Current
alias heartland="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/radio_heartland.pls" # MPR Radio Heartland
@sgergely
sgergely / gist:3793166
Created September 27, 2012 09:43
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name