Skip to content

Instantly share code, notes, and snippets.

View AdrianKoshka's full-sized avatar
🦉
Focusing

Adrian Lucrèce Céleste AdrianKoshka

🦉
Focusing
View GitHub Profile
@pksunkara
pksunkara / config
Last active April 28, 2024 18:59
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
@robinsmidsrod
robinsmidsrod / dhcpd.conf
Last active February 25, 2024 07:46
Trying to chainload iPXE with full feature set from a lesser featured one, whilst still being able to boot non-supported cards with UNDI
ddns-update-style none;
deny bootp; #default
authoritative;
include "/etc/dhcp/ipxe-option-space.conf";
# GREEN (private network)
subnet 10.1.1.0 netmask 255.255.255.0 {
range 10.1.1.100 10.1.1.199;
option subnet-mask 255.255.255.0;
@zellio
zellio / fbterm-hacks.md
Last active November 30, 2023 06:45
fbterm, installation and configuration hacks

fbterm setup and config hacks

Installation and setup

Install fbterm via your favorite package manager

pacman -S fbterm
@KittyKatt
KittyKatt / pomf
Last active March 24, 2018 14:49
pomf.se BASH script to upload images
#!/usr/bin/env bash
# pomf.se uploader
# requires: curl
dest_url='http://pomf.se/upload.php'
return_url='http://a.pomf.se'
if [[ -n "${1}" ]]; then
file="${1}"
if [ -f "${file}" ]; then
@Slackwise
Slackwise / force_time_sync_win.rb
Last active February 5, 2024 00:39
I hibernate my VMs at work when I'm done, and the time is always off. I can't just sync with w32tm because if I'm more than 24 hours off, it will refuse to sync.
require 'net/ntp' # gem install net-ntp
# Windows' date command expects MM/DD/YYYY, e.g. 5/15/2009
DATE_FORMAT = '%m/%d/%Y'
# Windows' time command expects HH:MM:SS AM/PM, e.g. 5:34:00 PM
TIME_FORMAT = '%I:%M:%S %p'
# External NTP is now firewalled :(
NTP_SERVER = 'MILLDATA'
@robinsmidsrod
robinsmidsrod / dhcpd.conf
Last active August 26, 2023 12:24
Booting an Apple Mac into iPXE using simulated Apple Boot Server on ISC DHCPD
next-server 10.0.3.2;
if ( substring(option vendor-class-identifier, 0, 9) = "AAPLBSDPC"
and substring(option vendor-class-identifier, 10, 4) = "i386" ) {
# This needs to be there to tell the client we're an Apple boot server
option vendor-class-identifier "AAPLBSDPC";
# Normally the client asks for a list, we respond, they tell us what we want,
# then we send a select back with the information of that image.
# This skips all that and forces the select down to the client.
option vendor-encapsulated-options 01:01:02;
# Use ipxe.efi for native drivers, or snponly.efi for underlying UNDI
import os, random, string, sys, urllib2
num_pics = 1
if len(sys.argv) > 1:
num_pics = int(sys.argv[1])
while num_pics > 0:
name = ''.join(random.sample(string.letters+string.digits, 5)) + '.jpg'
img = urllib2.urlopen("http://i.imgur.com/" + name).read()
if len(img) != 503: # 'image not found' is 503 bytes
@cfilipov
cfilipov / SwiftGenericTrie.md
Last active July 21, 2016 00:49
Generic-Key Trie in Swift

Generic Trie in Swift

This is an attempt to implement a trie in Swift with a generic key. Instead of using just strings as keys, this trie can be keyed by any object that can generate its own prefixes. This is accomplished by using a protocol to define a trie key that can return a generator of Hashables. We need Hashables because the prefixes will be stored in a Dictionary.

Defining the Key Type

The TrieNode class will be a private implementation detail. It helps to separate the implementation into TrieNode and the wrapper for a few reasons:

  1. If we want to extend the trie to implement some common Swift collection protocols, many of those don't make sense for every node.
  2. We want references for nodes but the wrapper struct can help us simulate value semantics.
@mcxiaoke
mcxiaoke / nginx-gitweb.md
Created January 18, 2016 02:54
Set up Gitweb + Nginx from scratch on Debian Wheezy

This guide offers the least time-consuming way of setting up Nginx for serving Git repositories over HTTP using Gitweb. The stuff here has been tested with Git 1.9.1 and Nginx 1.6.0 on Debian Wheezy. Probably also works for Ubuntu, etc.

Total time ~ 10 minutes.

Install

Enable wheezy-backports by adding this line to /etc/apt/sources.list:

deb http://http.debian.net/debian wheezy-backports main
@MichaelPote
MichaelPote / himawari.ps1
Created February 3, 2016 19:11
Windows Powershell Script to download the latest image from the Himawari-8 satelite, combine the tiles into a single image, convert to jpg and then set as the desktop background.
#
# Himawari-8 Downloader
#
#
#
# This script will scrape the latest image from the Himawari-8 satellite, recombining the tiled image,
# converting it to a JPG which is saved in My Pictures\Himawari\ and then set as the desktop background.
#
# http://himawari8.nict.go.jp/himawari8-image.htm
#