Skip to content

Instantly share code, notes, and snippets.

View rupurt's full-sized avatar
🏠
Working from home

Alex Kwiatkowski rupurt

🏠
Working from home
View GitHub Profile
while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; sh test; } | nc -l 8080; done
#!/bin/bash
echo "************PRINT SOME TEXT***************\n"
echo "Hello World!!!"
echo "\n"
echo "Resources:"
vmstat -S M
@rupurt
rupurt / boltbrowser
Created April 10, 2018 17:02
GUI to navigate bolt databases
boltbrowser ~/.chainlink/db.bolt
@rupurt
rupurt / host_and_connect.sh
Last active April 30, 2018 20:36
Host & Connect to tmux session
# Hoster
# Serveo
ssh -R 1500:localhost:22 serveo.net
# ngrok
ngrok tcp 22
# tmux
tmux -S /tmp/pair
chmod 777 /tmp/pair
@rupurt
rupurt / go_tests_with_fswatch.sh
Last active March 27, 2018 17:39
Run go tests on with fswatch
fswatch -0 -r -e ".*/4913" -e ".*/\.git/.*" . | tee /tmp/fswatch-changes | xargs -0 -n 1 -I {} richgo test ./...
@rupurt
rupurt / current-locks.sql
Created August 14, 2017 17:10
Current Postgres Locks
SELECT
pg_class.relname,
pg_locks.mode
FROM pg_locks
JOIN pg_class ON pg_class.oid = pg_locks.relation
ORDER BY mode ASC;
DROP TABLE IF EXISTS test;
CREATE TABLE test();
CREATE OR REPLACE FUNCTION dummy_tg() RETURNS TRIGGER
LANGUAGE plpgsql AS $$ BEGIN END; $$;
BEGIN;
CREATE TRIGGER blah BEFORE INSERT ON test FOR EACH ROW EXECUTE PROCEDURE dummy_tg();

Keybase proof

I hereby claim:

  • I am rupurt on github.
  • I am alexdk (https://keybase.io/alexdk) on keybase.
  • I have a public key ASACLJAL045gVMm5anwXZk29TYdLN84LM2BcA5Wy8BtDnwo

To claim this, I am signing this object:

def user_names
users.map { |u|
u.name
}
end
user_names = users.map { |u| u.name }
@rupurt
rupurt / copy_postgres_database.bash
Created August 29, 2016 16:34
Copy postgres database
createdb -O alex -T oldname newname
after(:each) do
errors = page.driver.browser.manage.logs.get(:browser)
if errors.present?
message = errors.map(&:message).join("\n")
puts message
end
end