George Opritescu

Developer from somewhere

interesting project

A very interesting project here

Read More

starting emacs in terminal

Here’s how to start emacs in terminal:

emacs -nw
Read More

memcached SASL ubuntu

sudo apt-get -f install libsasl2-2 sasl2-bin libsasl2-2 libsasl2-dev libsasl2-modules

Create a sasl folder in your user’s home directory, with the following content:

mech_list: plain
log_level: 5
sasldb_path: /home/john/sasl/sasldb2

Create the database file:

saslpasswd2 -c -a memcached -f /home/john/sasl/sasldb2 your_user_name

Start memcached with SASL enabled:

SASL_CONF_PATH=~/sasl memcached -vvv -S 
Read More

migrating a heroku database

Put app in maintenance:

heroku maintenance:on -a some-app

Create backup

heroku pgbackups:capture --expire -a some-app

Add new db addon, and check color in heroku config, and restore from backup:

heroku pgbackups:restore HEROKU_POSTGRESQL_COLOUR -a some-app

After everything’s been done, promote it to be the main DB:

heroku pg:promote HEROKU_POSTGRESQL_COLOUR -a some-app

Remove maintenance, and restart app:

heroku maintenance:off -a some-app
heroku restart -a some-app
Read More

go extension manager

Seems interesting, need to try it out: [go extension manager] (https://github.com/adeven/goem)

Read More
go

manually triggering newrelic errors

I triggered an error manually from the console like this:

irb(main):008:0> NewRelic::Agent.manual_start
=> [NewRelic::Agent::Samplers::CpuSampler, NewRelic::Agent::Samplers::MemorySampler, NewRelic::Agent::Samplers::ObjectSampler, NewRelic::Agent::
Samplers::DelayedJobSampler]
irb(main):009:0> NewRelic::Agent.notice_error(RuntimeError.new("no way"))

Of course when running in an environment where the agent is already started, you’d have to call only notice_error.

Read More

comparing binary files

Here’s how to compare two binary files:

diff <(xxd some.bin) <(xxd some_other.bin)
Read More

identifying fs type

sudo blkid /dev/sdX
Read More

setting a global gitignore file

If you want to set a global gitignore file, that would apply to all your repos, you can do so like this:

git config --global core.excludesfile '~/.gitignore'
Read More

rename a tmux window

To rename a tmux window, run this command: rename-window some_string

Read More