Skip to content

Instantly share code, notes, and snippets.

53efce2fac05667a03e9d37fc27b56be
@ogny
ogny / 000-readme.md
Last active February 12, 2019 13:48 — forked from thomasdarimont/000-readme.md
nginx upstream backend

Python 2.7

python -m SimpleHTTPServer

Python 3.x

python -m http.server

Terminal 1

python -m http.server 8001

@ogny
ogny / gist:2e494823da5cca8768d3d2bab8bdfbb0
Created August 26, 2016 10:59 — forked from tjackowiak/gist:5058743
Moving Graphite database
1. Stop Apache
sudo /etc/init.d/apache2 stop
2. Stop Carbon
sudo su www-data
cd /opt/graphite/
./bin/carbon-cache.py stop
3. Move whisper directory to new location
@ogny
ogny / redis_bulk.sh
Created February 2, 2016 13:59 — forked from egemenyildiz/redis_bulk.sh
Redis key'lerde toplu degisiklik
# Bulk deletes keys start with "prefix"
EVAL "for i, name in ipairs(redis.call('KEYS', 'prefix*')) do redis.call('DEL', name); end" 0
# Bulk renames keys start with "prefix" to "postfix".
# e.g. prefixwithtail -> postfixwithtail
EVAL "for i, name in ipairs(redis.call('KEYS', 'prefix*')) do local x = string.gsub(name, 'pre', 'post'); redis.call('RENAME', name, x); end" 0
@ogny
ogny / postgresql-list-and-order-tables-by-size
Created January 13, 2016 08:26
postgresql list and order tables by size
SELECT
schema_name,
relname,
pg_size_pretty(table_size) AS size,
table_size
FROM (
SELECT
pg_catalog.pg_namespace.nspname AS schema_name,
relname,
@ogny
ogny / new_gist_file.md
Created January 8, 2016 21:17
git push requires username and password

Git notlari

  • repo baglantisi https ise ve kullanici adi / parola soruyorsa; git remote set-url origin git@github.com:username/repo.git
@ogny
ogny / supervisord_init_script
Created January 4, 2016 08:12
supervisord sysVinit script
#!/bin/sh
#
# /etc/rc.d/init.d/supervisord
#
# Supervisor is a client/server system that
# allows its users to monitor and control a
# number of processes on UNIX-like operating
# systems.
#
# chkconfig: - 64 36
@ogny
ogny / tmux-cheatsheet.markdown
Last active September 4, 2015 09:03 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@ogny
ogny / keybase.md
Last active December 22, 2015 13:48
ogny@keybase.io

Keybase proof

I hereby claim:

  • I am ogny on github.
  • I am ogny (https://keybase.io/ogny) on keybase.
  • I have a public key whose fingerprint is 78F0 E836 DE19 9CC7 0727 D076 05C4 0038 1D68 DCAD

To claim this, I am signing this object: