Skip to content

Instantly share code, notes, and snippets.

View wuarmin's full-sized avatar
♥️
loves life

Armin wuarmin

♥️
loves life
  • Austria
View GitHub Profile
#!/usr/bin/env bash
set -eou pipefail
cd /home/pi
git clone https://github.com/popcornmix/omxplayer.git
cd omxplayer
sudo apt-get update && sudo apt install -y git libasound2-dev libva2 libpcre3-dev libidn11-dev libboost-dev libdbus-1-dev libssh-dev libsmbclient-dev libssl-dev
# see https://github.com/popcornmix/omxplayer/issues/731
@przbadu
przbadu / react_on_docker2.md
Created October 29, 2020 04:31
Docker configuration to run react app

Setup docker to run React app

After setting up docker to generate React app without installing node js in https://gist.github.com/przbadu/4a62a5fc5f117cda1ed5dc5409bd4ac1 It was confusing to some of the devs, how to run react app, so I am creating this as second step to the configuration.

Generate required files in your react project

cd my-react-app
touch Dockerfile Dockerfile.dev docker-compose.yml .dockerignore
@rambabusaravanan
rambabusaravanan / client.py
Created November 13, 2017 14:20
Simple TCP Streaming Server Client in Python
# Streaming Client
import socket
HOST = 'localhost'
PORT = 50007
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
while True:
@ravibhure
ravibhure / git_rebase.md
Last active April 3, 2024 08:38
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@jctosta
jctosta / screen_cheatsheet.markdown
Last active April 18, 2024 18:19
Screen Cheatsheet

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@edvardm
edvardm / symbolize_recursive.rb
Last active May 22, 2020 04:17
Recursively symbolize ruby hash keys in a nested structure. Uses refinements instead of monkey patching Hash.
module SymbolizeHelper
extend self
def symbolize_recursive(hash)
{}.tap do |h|
hash.each { |key, value| h[key.to_sym] = transform(value) }
end
end
private
@kalmbach
kalmbach / gist:4471560
Created January 7, 2013 01:27
Rake task sugar for Sequel Migrations (version, migrate, rollback, reset)
namespace :db do
require "sequel"
Sequel.extension :migration
DB = Sequel.connect(ENV['DATABASE_URL'])
desc "Prints current schema version"
task :version do
version = if DB.tables.include?(:schema_info)
DB[:schema_info].first[:version]
end || 0
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active April 23, 2024 19:14
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'