Skip to content

Instantly share code, notes, and snippets.

@ealize
ealize / extensions.txt
Created April 8, 2019 19:40
List of Chrome Extensions
Modify Headers
https://chrome.google.com/webstore/detail/modify-headers-for-google/innpjfdalfhpcoinfnehdnbkglpmogdi
@ealize
ealize / upgrade-openwrt.md
Created February 3, 2019 08:12
upgrade openWRT with extRoot

Run sysupgrade or upload the new file with LuCI.

opkg update opkg install block-mount opkg install kmod-fs-ext4 opkg install kmod-usb-storage mount /dev/sda1 /mnt

@ealize
ealize / update_kext_cache.sh
Created October 29, 2018 19:02
update_kext_cache.sh
echo "Fixing ownership and permissions..."
sudo chmod -R 755 /Library/Extensions/*
sudo chmod -R 755 /System/Library/Extensions/*
sudo chown -R root:wheel /Library/Extensions/*
sudo chown -R root:wheel /System/Library/Extensions/*
sudo chown root:admin /
echo "Rebuilding kext cache..."
sudo kextcache -system-prelinked-kernel
sudo kextcache -system-caches
@ealize
ealize / Upgrade.md
Last active October 19, 2018 02:36
OpenWRT upgrade with EXTRoot
opkg upgrade $(opkg list-upgradable | awk '($1 !~ "^kmod|Multiple") {print $1}')
@ealize
ealize / osx-set-all-names.sh
Last active September 12, 2018 05:01 — forked from jacobsalmela/osx-set-all-names.sh
Set all four OS X computer names using a script.
#!/bin/bash
read -p "Enter new machine name: " MAC_NAME
# Bonjour name ending in .local
scutil --set LocalHostName "$MAC_NAME"
# Friendly name shown in System Preferences > Sharing
scutil --set ComputerName "$MAC_NAME"
# The name recognized by the hostname command
scutil --set HostName "$MAC_NAME"
# Save the computer's serial number in a variable so it can be used in the next command.
serialNum=$(ioreg -l | awk '/IOPlatformSerialNumber/ { split($0, line, "\""); printf("%s\n", line[4]); }')
#!/bin/bash
echo "New Machine name?"
read newHostName
echo "Setting new $newHostName"
sudo scutil --set ComputerName $newHostName
sudo scutil --set LocalHostName $newHostName
sudo scutil --set HostName $newHostName
@ealize
ealize / config.fish-non-interactive
Created March 4, 2016 06:25
Fish shell non-interactive/non-login mode
# Prevent Fish shell from generating strings when in non-interactive mode (e.g. while using SCP)
# Add this to the top of your config.fish file
if not status --is-login or not status --is-interactive
exit
end

Keybase proof

I hereby claim:

  • I am ealize on github.
  • I am sri (https://keybase.io/sri) on keybase.
  • I have a public key whose fingerprint is C2E1 E7B2 024D 4056 1BC3 9C81 8EF2 D8DB 3DD0 0B8D

To claim this, I am signing this object:

When should you use DateTime and when should you use Time?

It's a common misconception that [William Shakespeare][1] and [Miguel de Cervantes][2] died on the same day in history - so much so that UNESCO named April 23 as [World Book Day because of this fact][3]. However because England hadn't yet adopted [Gregorian Calendar Reform][4] (and wouldn't until [1752][5]) their deaths are actually 10 days apart. Since Ruby's Time class implements a [proleptic Gregorian calendar][6] and has no concept of calendar reform then there's no way to express this. This is where DateTime steps in:

>> shakespeare = DateTime.iso8601('1616-04-23', Date::ENGLAND)
=> Tue, 23 Apr 1616 00:00:00 +0000
>> cervantes = DateTime.iso8601('1616-04-23', Date::ITALY)
=> Sat, 23 Apr 1616 00:00:00 +0000
@ealize
ealize / notepadxml
Created January 3, 2012 19:27
Notepad++ Auto XML formatting
; quick reference: http://tidy.sourceforge.net/docs/quickref.html
; cesky preklad: http://www.pspad.com/cz/tidy.htm
; sample config file for HTML tidy from http://www.w3.org/People/Raggett/tidy/
; from: http://www.twu.ca/divisions/technology/sst/orion/blog/tidy-notepad-and-xml.html
; save and restart Notepad++
[Sample from Web Page]
indent: auto
indent-spaces: 2
wrap: 72