Skip to content

Instantly share code, notes, and snippets.

View jasiek's full-sized avatar

Jan Szumiec jasiek

View GitHub Profile
@schacon
schacon / better-git-branch.sh
Created January 13, 2024 18:41
Better Git Branch output
#!/bin/bash
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NO_COLOR='\033[0m'
BLUE='\033[0;34m'
YELLOW='\033[0;33m'
NO_COLOR='\033[0m'
@munckymagik
munckymagik / PostgreSQL - EXPLAIN cheatsheet.md
Last active May 29, 2024 14:53
PostgreSQL - EXPLAIN cheatsheet

PostgreSQL - EXPLAIN cheatsheet

  • -> Marks the start of info on a "plan node"
  • Work from the leaves to the root to understand what happened first
(cost=0.00..5.04 rows=101 width=0)
  • (cost=
@Joilence
Joilence / roam-obsidian-date-convert.py
Last active January 31, 2024 19:00 — forked from jenningsb2/roam-obsidian-date-convert.py
Convert date format in file names and contents from Roam Research default style to Obsidian default style.
import re
import os
from dateutil.parser import parse
path = '' #insert file path to your vault here
### Convert date format in file content
for root, dirs, files in os.walk(path):
files = [f for f in files if re.match(r'.*\.md', f)] # only keep files end with `.md`
@hfreire
hfreire / qemu_osx_rpi_raspbian_jessie.sh
Last active March 24, 2024 14:35
How to emulate a Raspberry Pi (Raspbian Jessie) on Mac OSX (El Capitan)
# Install QEMU OSX port with ARM support
sudo port install qemu +target_arm
export QEMU=$(which qemu-system-arm)
# Dowload kernel and export location
curl -OL \
https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/kernel-qemu-4.1.7-jessie
export RPI_KERNEL=./kernel-qemu-4.1.7-jessie
# Download filesystem and export location
@stevegraham
stevegraham / deal_with_it.rb
Created December 18, 2014 17:02
#20YearsOfCharacters #DealWithIt
require 'net/http'
require 'logger'
require 'mechanize'
logger = Logger.new(STDOUT)
req = Net::HTTP::Get.new '/'
drop_time = Time.local 2014, 12, 19, 12
req['User-Agent'] = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/600.1.17 (KHTML, like Gecko) Version/7.1 Safari/537.85.10"
@QueuingKoala
QueuingKoala / setup.sh
Last active May 16, 2024 09:32
Sub-CA example
# Assumptions: easyrsa3 available in current dir, and functional openssl.
# This basic example puts the "offline" and "sub" PKI dirs on the same system.
# A real-world setup would use different systems and transport the public components.
# Build root CA:
EASYRSA_PKI=offline ./easyrsa init-pki
EASYRSA_PKI=offline ./easyrsa build-ca nopass
# Build sub-CA request:
EASYRSA_PKI=sub ./easyrsa init-pki
anonymous
anonymous / gist:4380991
Created December 26, 2012 15:45
Apple Mac Mini G4 automatic power-on upon power failure (FreeBSD 9.0)
[jps@sol ~]$ uname -a
FreeBSD sol 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Wed Jan 4 08:17:39 UTC 2012 marcel@xserve.lan.xcllnt.net:/usr/obj/usr/src/sys/GENERIC powerpc
[jps@sol ~]$ dmesg | grep cpu
cpu0: Motorola PowerPC 7447A revision 1.2, 1250.28 MHz
cpu0: Features 9c000000<PPC32,ALTIVEC,FPU,MMU>
cpu0: HID0 8450c0bc<EMCP,TBEN,NAP,DPM,ICE,DCE,SGE,BTIC,LRSTK,FOLD,BHT>
cpulist0: <Open Firmware CPU Group> on nexus0
cpu0: <Open Firmware CPU> on cpulist0
dfs0: <Dynamic Frequency Switching> on cpu0
[jps@sol ~]$ sysctl -a | grep pmu
@romanr
romanr / com.apache.activemq.plist
Created July 11, 2012 09:15
Homebrew activemq launchDaemon script
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.apache.activemq</string>
<key>WorkingDirectory</key>
<string>/usr/local/Cellar/activemq/5.5.1/libexec</string>
@bmarini
bmarini / Procfile
Created May 25, 2012 17:51
Goliath app to serve static files
web: bundle exec ruby app.rb -sv -e prod -p $PORT