Skip to content

Instantly share code, notes, and snippets.

View andreabadesso's full-sized avatar

André Abadesso andreabadesso

View GitHub Profile
@SkaTeMasTer
SkaTeMasTer / log-rotate
Created February 13, 2017 08:51
Log rotate is important to keep the SD cards on Raspberry pi from corruption, disable any logging when possible (after debugging)
Logfile RoATING file operations using UNIX logrotate utility.
=============================================
+ Rotate the log file when file size reaches a specific size
+ Continue to write the log information to the newly created file after rotating the old log file
+ Compress the rotated log files
+ Specify compression option for the rotated log files
+ Rotate the old log files with the date in the filename
+ Execute custom shell scripts immediately after log rotation
+ Remove older rotated log files
# QEmu
brew install qemu
# Home for out tests
mkdir ~/arm-emu
cd ~/arm-emu
# Download initrd and kernel
wget http://ftp.de.debian.org/debian/dists/jessie/main/installer-armel/current/images/versatile/netboot/initrd.gz
@john45traver
john45traver / rearrangeable.js.coffee
Created June 10, 2014 20:44
Rearrangeable Grid Coffeescript
Engine = require 'famous/core/Engine'
Surface = require 'famous/core/Surface'
View = require 'famous/core/View'
Transform = require 'famous/core/Transform'
RenderNode = require 'famous/core/RenderNode'
StateModifier = require 'famous/modifiers/StateModifier'
Easing = require 'famous/transitions/Easing'
Transitionable = require 'famous/transitions/Transitionable'
SpringTransition = require 'famous/transitions/SpringTransition'
WallTransition = require 'famous/transitions/WallTransition'
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 6, 2024 12:37
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%'
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 7, 2024 02:33
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jobliz
jobliz / RedisPythonPubSub1.py
Created May 4, 2012 17:58
A short script exploring Redis pubsub functions in Python
import redis
import threading
class Listener(threading.Thread):
def __init__(self, r, channels):
threading.Thread.__init__(self)
self.redis = r
self.pubsub = self.redis.pubsub()
self.pubsub.subscribe(channels)
@didip
didip / supervisord-example.conf
Created January 30, 2011 05:10
Example configuration file for supervisord.conf
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon