Skip to content

Instantly share code, notes, and snippets.

View mapopa's full-sized avatar
🎯
Focusing

Popa Adrian Marius mapopa

🎯
Focusing
View GitHub Profile
@mapopa
mapopa / dmesg.log
Created December 8, 2017 09:35
ec2 r4 to m5 migration error
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.4.0-103-generic (buildd@lcy01-amd64-001) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5) ) #126-Ubuntu SMP Mon Dec 4 16:23:28 UTC 2017 (Ubuntu 4.4.0-103.126-generic 4.4.98)
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.4.0-103-generic root=UUID=73362e04-90b8-4c53-b878-2097820e0b34 ro console=tty1 console=ttyS0
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] AMD AuthenticAMD
[ 0.000000] Centaur CentaurHauls
[ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
[ 0.000000] x86/fpu: xstate_offset[3]: 960, xstate_sizes[3]: 64
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@mapopa
mapopa / billiard_backtrace
Created October 31, 2012 10:04
billiard backtrace
[pid 9718] write(2, " File \"/usr/local/lib/python2.7"..., 92) = 92
[pid 9718] open("/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", O_RDONLY) = 11
[pid 9718] fstat(11, {st_mode=S_IFREG|0644, st_size=6910, ...}) = 0
[pid 9718] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fad60dbd000
[pid 9718] read(11, "\"\"\"\nSettings and configuration f"..., 4096) = 4096
[pid 9718] write(2, " ", 4) = 4
[pid 9718] write(2, "self._wrapped = Settings(setting"..., 42) = 42
[pid 9718] close(11) = 0
[pid 9718] munmap(0x7fad60dbd000, 4096) = 0
[pid 9718] write(2, " File \"/usr/local/lib/python2.7"..., 94) = 94
@mapopa
mapopa / celeryd_debug.log
Created October 31, 2012 09:54
celeryd debug log
sh -x /etc/init.d/celeryd start
+ DEFAULT_PID_FILE=/var/run/celeryd@%n.pid
+ DEFAULT_LOG_FILE=/var/log/celeryd@%n.log
+ DEFAULT_LOG_LEVEL=DEBUG
+ DEFAULT_NODES=celery
+ DEFAULT_CELERYD=-m celery.bin.celeryd_detach
+ CELERY_DEFAULTS=/etc/default/celeryd
+ test -f /etc/default/celeryd
+ . /etc/default/celeryd
+ CELERYD_NODES=w1
@mapopa
mapopa / celery_default
Created October 31, 2012 09:40
django celery
cat /etc/default/celeryd
# Name of nodes to start
# here we have a single node
CELERYD_NODES="w1"
# Where to chdir at start.
CELERYD_CHDIR="/home/mariuz/test"
# How to call "manage.py celeryd_multi"
CELERYD_MULTI="$CELERYD_CHDIR/manage.py celeryd_multi"
@mapopa
mapopa / force monitor.sh
Created October 26, 2012 09:34
force monitor resoltion when is not recognized
# force monitor resolution folowing this guide https://wiki.ubuntu.com/X/Config/Resolution#Adding_undetected_resolutions
# first calculate the modeline
cvt 1920 1080 60
# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
# next add the new modeline , copy paste the above line
xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode DVI-1 1920x1080
@mapopa
mapopa / thin_init.sh
Created October 24, 2012 09:06
start thin in user rvm with env , solves /usr/bin/env: ruby_noexec_wrapper: No such file or directory
#!/bin/sh
### BEGIN INIT INFO
# Provides: thin
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: thin initscript
# Description: thin
### END INIT INFO
@mapopa
mapopa / rake db_migrate.txt
Created October 19, 2012 20:43
rake db:migrate haml_app
rake db:migrate
== CreateDeviseUsers: migrating ==============================================
-- create_table(:devise_users)
-> 1.1871s
-> -1 rows
== CreateDeviseUsers: migrated (1.1873s) =====================================
== CreateMicroposts: migrating ===============================================
-- create_table(:microposts)
-> 0.9341s

Don't use MongoDB

I've kept quiet for awhile for various political reasons, but I now feel a kind of social responsibility to deter people from banking their business on MongoDB.

Our team did serious load on MongoDB on a large (10s of millions of users, high profile company) userbase, expecting, from early good experiences, that the long-term scalability benefits touted by 10gen

@mapopa
mapopa / asound.conf
Created December 21, 2011 10:10
cat /etc/asound.conf , use USB-Audio - Microsoft LifeChat LX-3000 as default card
# http://alsa.opensrc.org/FAQ026
# cat /proc/asound/cards
# 0 [HDMI ]: HDA-Intel - HDA ATI HDMI
# HDA ATI HDMI at 0xfeaec000 irq 44
# 1 [LX3000 ]: USB-Audio - Microsoft LifeChat LX-3000
pcm.!default {