Skip to content

Instantly share code, notes, and snippets.

View sleepdefic1t's full-sized avatar

₴Ⱡ33₱ sleepdefic1t

View GitHub Profile
/**************************************************************************/
/*!
@file readMifareClassic.pde
@author Adafruit Industries
@license BSD (see license.txt)
This example will wait for any ISO14443A card or tag, and
depending on the size of the UID will attempt to read from it.
If the card has a 4-byte UID it is probably a Mifare
@sleepdefic1t
sleepdefic1t / RPI_CLEAR_HISTORY_SHUTDOWN
Created September 21, 2017 19:09
Raspberry Pi terminal command for clearing the bash history and shutting down. Useful for custom images.
history -c && history -w && sudo shutdown now
@sleepdefic1t
sleepdefic1t / RPI_CHECK_FREESPACE_CLEAN
Created September 22, 2017 20:43
Commands for checking free space and cleaning packages of RPi install.
df -Bm
sudo apt-get clean
df -Bm
@sleepdefic1t
sleepdefic1t / macOS_MOUNT_EFI
Created October 2, 2017 11:53
Mounts EFI Partition of macOS installation. Useful for multi-boot environments.
mkdir mnt && sudo mount -t msdos /dev/disk0s1 mnt
@sleepdefic1t
sleepdefic1t / RPI_FORCE_CLEAR_LOGS
Last active October 12, 2017 12:26
Raspberry Pi terminal command for force-emptying system logs. Useful for custom images.
sudo bash -c 'for i in $(find /var/log -type f); do cat /dev/null > $i; done'
@sleepdefic1t
sleepdefic1t / DARK_SNAPSHOT
Last active October 26, 2017 11:07
wget a current snapshot of the Ark Devnet Blockchain
// cd to nodes snapshot 'db' directory
sudo wget https://dsnapshots.ark.io/current -O devark-node.db
@sleepdefic1t
sleepdefic1t / RPI_TIME_UPDATE
Created October 29, 2017 16:24
One-line command to update Raspberry Pi system-time. Obviously, you must be connected to the web.
// one-line time-update
sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"
function update() {
SpreadsheetApp.getActiveSheet().getRange("F6").setValue(Math.random());
}
function getHeight(rand) {
try {
var response = UrlFetchApp.fetch("https://api.arkcoin.net/api/blocks/getHeight");
if(response.getResponseCode() === 200) {
var json = JSON.parse(response.getContentText());

Keybase proof

I hereby claim:

  • I am sleepdefic1t on github.
  • I am sleepdeficit (https://keybase.io/sleepdeficit) on keybase.
  • I have a public key ASCeOrZ37AdH_Ssay4CWojsLeRGRf7unR4RnAghHFKHduQo

To claim this, I am signing this object:

@sleepdefic1t
sleepdefic1t / arduino2html.py
Created November 26, 2017 15:29
Converts raw HTML to an Arduino compatible HTML-string | cp from https://github.com/FanaHOVA/HTML2Arduino
def raw2arduino():
i = open("raw.html", 'r')
o = open("arduino.html", 'a')
for line in i.readlines():
o.write('client.println("')
o.write(line.strip("\n"))
o.write('");\n')
i.close()
o.close()
print "Done!"