Skip to content

Instantly share code, notes, and snippets.

View colinux's full-sized avatar

Colin Darie colinux

  • Démarches Simplifiées
  • Provence, France
View GitHub Profile
@kylefox
kylefox / gist:4512777
Created January 11, 2013 18:15
If you want to use Xcode's FileMerge as your git mergetool, this is how you set it up.
# Tell system when Xcode utilities live:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
# Set "opendiff" as the default mergetool globally:
git config --global merge.tool opendiff
@ctavan
ctavan / gist:4482825
Last active February 18, 2019 16:09
Init-script for optionally starting multiple redis instances on the same host running Ubunut/Debian. Highly inspired by the memcached init script that comes with the Ubuntu package. This is useful since redis is single-threaded.
#! /bin/bash
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@johntyree
johntyree / getBlockLists.sh
Last active March 9, 2024 12:32
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'
The Redis Book (don't know still what the final title will be ;)
authors: Pieter Noordhuis, Ted Nyman, Salvatore Sanfilippo, 33.33333333% each
writing it with O'Reilly
01-introduction 11.26% (31 pages)
02-volatile-keys 7.76% (21 pages)
03-data-integrity 12.6% (35 pages)
04-replication 6.16% (17 pages)
05-messaging 5.16% (14 pages)
# compl1.rb - Redis autocomplete example
# download female-names.txt from http://antirez.com/misc/female-names.txt
require 'rubygems'
require 'redis'
r = Redis.new
# Create the completion sorted set
if !r.exists(:compl)

Vérifier que le partitionnement convient

Avant de se lancer, rien de tel que revoir le partitionnement, car après, c'est un peu plus dur.

Changer le mot de passe root

$ passwd

Ouvrir une nouvelle fenêtre SSH et tester le nouveau mot de passe.

# Build an inverted index for a full-text search engine with Redis.
# Copyright (C) 2009 Salvatore Sanfilippo. Under the BSD License.
# USAGE:
#
# ruby invertedindex.rb add somedir/*.c
# ruby invertedindex.rb add somedir/*.txt
# ruby search your query string
require 'rubygems'
require 'redis'