Skip to content

Instantly share code, notes, and snippets.

View cosmincatalin's full-sized avatar
👻

Cosmin Catalin SANDA cosmincatalin

👻
View GitHub Profile
@czarneckid
czarneckid / gist:1536207
Created December 29, 2011 21:08
Installing older or specific versions of Homebrew formulas

We first want to take a look at what versions are installed for a given formula, brew info FORMULA. Let's take a look at the versions of Redis that are installed.

@czq. ➜  Formula rvm:() git:(master) brew info redis
redis 2.4.5
http://redis.io/
/usr/local/Cellar/redis/2.4.4 (9 files, 460K)
/usr/local/Cellar/redis/2.4.5 (9 files, 460K) *
...
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@colorful-tones
colorful-tones / ClearDNSCache
Created June 11, 2013 14:40
clear dns cache on mac via Terminal or iTerm
sudo killall -HUP mDNSResponder
@fedir
fedir / checkUrlExists.m1.py
Last active May 25, 2022 14:56
Check if URL exists via Python
from urllib2 import urlopen
code = urlopen("http://example.com/").code
if (code / 100 >= 4):
print "Nothing there."
# via http://stackoverflow.com/questions/1966086/how-can-i-determine-if-anything-at-the-given-url-does-exist
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@mitchwongho
mitchwongho / Docker
Last active November 29, 2023 06:36
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@tmcgrath
tmcgrath / Spark aggregateByKey
Created December 2, 2014 14:41
Spark aggregateByKey example
Welcome to
____ __
/ __/__ ___ _____/ /__
_\ \/ _ \/ _ `/ __/ '_/
/___/ .__/\_,_/_/ /_/\_\ version 1.1.0
/_/
Using Scala version 2.10.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_65)
Type in expressions to have them evaluated.
Type :help for more information.
@jonschoning
jonschoning / pc.laptop
Last active October 10, 2022 11:33
/usr/share/X11/xkb/symbols/pc (swap CTRL+ALT+CAPS; ALT->CTRL, CAPS->ALT) https://github.com/jonschoning/xkb_symbols
default partial alphanumeric_keys modifier_keys
xkb_symbols "pc105" {
key <ESC> { [ Escape ] };
// The extra key on many European keyboards:
key <LSGT> { [ less, greater, bar, brokenbar ] };
// The following keys are common to all layouts.
key <BKSL> { [ backslash, bar ] };
@four43
four43 / redis-server
Created March 12, 2015 13:53
Redis Server - Init Script
#!/bin/sh
# From - http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# - https://github.com/saxenap/install-redis-amazon-linux-centos/blob/master/redis-server
#
# redis - this script starts and stops the redis-server daemon
# Originally from - https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
@yyolk
yyolk / install.sh
Last active October 14, 2016 10:54
Install RabbitMQ on Amazon linux, along with Erlang
# Modify /etc/yum.repos.d/epel.repo. Under the section marked [epel], change enabled=0 to enabled=1.
sudo yum install erlang --enablerepo=epel
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.1/rabbitmq-server-3.1.1-1.noarch.rpm
sudo rpm -Uvh rabbitmq-server-3.1.1-1.noarch.rpm
# Enable managament plugin
sudo rabbitmq-plugins enable rabbitmq_management