Skip to content

Instantly share code, notes, and snippets.

@crodjer
crodjer / pi-cooling.sh
Last active February 14, 2021 09:38
Raspberry Pi Cooling Test
#!/usr/bin/env bash
# A script to test the cooling performance of a RaspberryPi using `sysbench`
# Starts a syncbench process in the background and monitors the temperature.
#
# After the benchmark is complete, keeps the monitoring on to see how much time
# does the colling setup take to reach 55°C.
log () {
echo "$(date -Is)" $@
@crodjer
crodjer / a80-cleanup.sh
Created October 4, 2020 03:41
Remove Samsung A80 Bloatware
adb shell pm uninstall -k --user 0 com.google.android.apps.tachyon
adb shell pm uninstall -k --user 0 com.netflix.mediaclient
adb shell pm uninstall -k --user 0 com.netflix.partner.activation
adb shell pm uninstall -k --user 0 com.facebook.services
adb shell pm uninstall -k --user 0 com.facebook.system
adb shell pm uninstall -k --user 0 com.facebook.appmanager
adb shell pm uninstall -k --user 0 com.android.stk2
adb shell pm uninstall -k --user 0 com.samsung.android.aremoji
adb shell pm uninstall -k --user 0 com.samsung.android.ardrawing
adb shell pm uninstall -k --user 0 com.sec.android.app.fm
@crodjer
crodjer / keybase.md
Created March 1, 2017 05:54
Keybase Proof

Keybase proof

I hereby claim:

  • I am crodjer on github.
  • I am crodjer (https://keybase.io/crodjer) on keybase.
  • I have a public key ASBsTTGmlX4PXWkRYzIBz6ZAIBZCutTAWKnSuI6pusMdEQo

To claim this, I am signing this object:

@crodjer
crodjer / tic-tac-toe.elm
Last active August 1, 2016 04:30
Tic tac toe with Elm
import Array exposing (Array, get)
import Html exposing (Html, div, text)
import Html.Attributes exposing (style)
import Html.App as Html
import Html.Events exposing (onClick)
import Maybe exposing (withDefault)
import Random
import String
main : Program Never
@crodjer
crodjer / test_ws.py
Created August 22, 2015 12:50
Application to demonstrate testing tornado websockets
'''
Application to demonstrate testing tornado websockets.
Try it wiith: python -m tornado.testing discover
'''
from tornado import testing, httpserver, gen, websocket
from ws import APP
diff --git a/docs/netctl.profile.5.txt b/docs/netctl.profile.5.txt
index 6ad93a0..39fa644 100644
--- a/docs/netctl.profile.5.txt
+++ b/docs/netctl.profile.5.txt
@@ -428,6 +428,16 @@ type:
AT commands specific to certain Huawei modems; all other devices
should use `None'.
+'Init='::
+ An initialization string sent to the modem before dialing. This
@crodjer
crodjer / 1-redis-slow-log-segfault.log
Last active December 28, 2015 14:29
With redis-cli, multiple runs of the command `slowlog get` result in a Segmentation Fault. Redis versions: 2.8.0-rc6, current unstable (b2f834390c).
┌─[rohan@crodjer]-[09:02 PM] ± git:(f7f97bf)
└─> valgrind src/redis-cli ~/workspace/src/redis
==5398== Memcheck, a memory error detector
==5398== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==5398== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==5398== Command: src/redis-cli
==5398==
127.0.0.1:6379> config set slowlog-log-slower-than 1
OK
127.0.0.1:6379> slowlog get
@crodjer
crodjer / tornad-redis.test.log
Created June 19, 2013 14:31
Test output for tornado-redis over python3 via 2to3 tool. Command: `python -m tornado.testing tornadoredis.tests.pool &> test.log`
./tornadoredis/connection.py:77: ResourceWarning: unclosed <socket.socket object, fd=7, family=2, type=2049, proto=0>
self._stream = None
./tornadoredis/connection.py:77: ResourceWarning: unclosed <socket.socket object, fd=8, family=2, type=2049, proto=0>
self._stream = None
FFF.FFF./tornadoredis/connection.py:77: ResourceWarning: unclosed <socket.socket object, fd=9, family=2, type=2049, proto=0>
self._stream = None
F
======================================================================
FAIL: test_connection_pool (tornadoredis.tests.pool.ConnectionPoolTestCase)
----------------------------------------------------------------------
@crodjer
crodjer / string_integer.py
Created May 31, 2013 19:51
An unbounded integer stored in a string.
#!/usr/bin/env python3
import unittest
import random
try:
# Python3, cool!
from itertools import zip_longest
except ImportError:
# I am on python2
from itertools import izip_longest as zip_longest
@crodjer
crodjer / uuids.js
Created May 22, 2013 06:39
Javascript UUIDs
function uuids (count, seed) {
var pattern = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';
var _uuids = [];
if (count === undefined) {
count = 1;
}
if (seed === undefined) {