Skip to content

Instantly share code, notes, and snippets.

View will's full-sized avatar
🆒
ه҈ͣفͤ҈ͥ҉ͦ҈ͧ҉ͨ҈ͩ҉ͪ҈ͫ҉ͬ҈ͭ҉ͮ҈ͯ҉ͨ҈ͬ҉ͧ҈ͣ҉ͨ҈ͧ҉ͯ҈ͮ҉ͭ҈ͤ҉ͦ҈ͥ҉ͧ҈ͩ҉ͭ҈ͨ҉ͣ҈ͪ҉ͧ҈ͭ҉ͩ҈ͤ҉ͮ҈ͯ҉ͬ҈

Will Leinweber will

🆒
ه҈ͣفͤ҈ͥ҉ͦ҈ͧ҉ͨ҈ͩ҉ͪ҈ͫ҉ͬ҈ͭ҉ͮ҈ͯ҉ͨ҈ͬ҉ͧ҈ͣ҉ͨ҈ͧ҉ͯ҈ͮ҉ͭ҈ͤ҉ͦ҈ͥ҉ͧ҈ͩ҉ͭ҈ͨ҉ͣ҈ͪ҉ͧ҈ͭ҉ͩ҈ͤ҉ͮ҈ͯ҉ͬ҈
View GitHub Profile
@gjdv
gjdv / change_wifi.py
Created December 9, 2022 19:16
Script to change the wifi settings of a Daikin airco (tested on FTXA)
import requests
default_ip = '192.168.127.1'
def do_get(url):
try:
resp = requests.get(url)
except Exception as e:
raise Exception("Could not reach url: %s" % url) from e
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active July 20, 2024 23:50
Hyperlinks in Terminal Emulators
@ageis
ageis / systemd_service_hardening.md
Last active July 19, 2024 22:23
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
@robinsloan
robinsloan / unfave.rb
Last active June 5, 2022 21:32
Unfave script, because why not??
#!/usr/bin/env ruby
require "rubygems"
require "twitter"
require "json"
require "faraday"
# things you must configure
TWITTER_USER = "your_username"
# get these from dev.twitter.com
@[Link(ldflags: "-lpq -I`pg_config --includedir` -L`pg_config --libdir`")]
lib LibPQ
fun connect = PQconnectdb(conninfo : UInt8*) : Void*
fun exec = PQexec(conn : Void*, query : UInt8*) : Void*
fun getvalue = PQgetvalue(res : Void*, row : Int32, column : Int32) : UInt8*
end
conn = LibPQ.connect("postgres:///")
res = LibPQ.exec(conn, "select 'Hello it is ' || now()")
String.new(LibPQ.getvalue(res, 0, 0)) #=> "Hello it is 2015-07-15 16:30:44.396092-07"
@datanoise
datanoise / crystal-tags.cr
Last active March 5, 2021 03:24
ctags for crystal language
require "compiler/crystal/**"
require "option_parser"
include Crystal
class ToCtagsVisitor < Visitor
@filename : String
@lines : Array(String)
@io : IO
@opts : Generator
@will
will / postgres
Last active August 29, 2015 13:57
Running a devl build of postgres
git clone https://github.com/postgres/postgres.git && cd postgres
./configure --prefix=/tmp/postgres --with-openssl --with-ossp-uuid --with-libs=/usr/local/opt/readline/lib/ --with-includes=/usr/local/opt/readline/include/
# skip the readline parts if you dont have readline installed but it makes `psql` better
make -sj8
make install
/tmp/postgres/bin/initdb /tmp/postgres/data
@robinsloan
robinsloan / langoliers.rb
Last active June 25, 2024 17:12
The Langoliers, a tweet deletion script
require "rubygems"
require "twitter"
require "json"
# things you must configure
TWITTER_USER = "your_username"
MAX_AGE_IN_DAYS = 1 # anything older than this is deleted
# get these from dev.twitter.com
CONSUMER_KEY = "your_consumer_key"
#!/bin/sh
NAME=$1
DATADIR=${2:-.pg}
[ $NAME == "" ] && { echo usage: pg_dev NAME [DATADIR]; exit 1; }
echo Initializing database in $DATADIR
initdb $DATADIR