Skip to content

Instantly share code, notes, and snippets.

Avatar

PsyChip

View GitHub Profile
@PsyChip
PsyChip / redmi-debloater.cmd
Last active Feb 14, 2022
xiaomi redmi 9x debloater, just open adb shell and paste them all
View redmi-debloater.cmd
pm uninstall --user 0 miui.systemui.plugin
pm uninstall --user 0 com.miui.extraphoto
pm uninstall --user 0 com.miui.player
pm uninstall --user 0 com.miui.cleaner
pm uninstall --user 0 com.miui.notes
pm uninstall --user 0 com.miui.miwallpaper
pm uninstall --user 0 com.miui.analytics
pm uninstall --user 0 com.miui.yellowpage
pm uninstall --user 0 com.facebook.services
pm uninstall --user 0 com.facebook.katana
@PsyChip
PsyChip / bathscale.ino
Created Jan 20, 2019
Wireless Bathroom Scale
View bathscale.ino
/* Wireless Bathroom Scale
* Uses digispark pro (https://digistump.com)
*
* depends on hx711 and rcswitch libraries
* https://github.com/bogde/HX711
* https://github.com/sui77/rc-switch
*
*/
@PsyChip
PsyChip / import.sh
Created Jul 20, 2018
resumable gigantic csv importer for postgresql. csv column count must match with your table
View import.sh
#!/bin/bash
## usage:
## >import.sh filename.csv table database
folder=__csv
mkdir $folder
split -l 10000 $1 $folder/part
cd $folder
psql -c "copy $2 FROM 'partaa' DELIMITER ',' CSV HEADER;" $3;
@PsyChip
PsyChip / asound.conf
Last active Jul 20, 2018
alsa configuration file for simultaneous playback from multiple audio sources. no pulseaudio or X server needed
View asound.conf
## alsa configuration file for simultaneous playback
## from multiple audio sources
## confirmed on orange pi zero, raspberry pi B+
## save to /etc/asound.conf
## http://psychip.net
pcm.!default {
type plug
slave.pcm "dmixer"
@PsyChip
PsyChip / sync.sh
Created Jan 10, 2018
sync local updates with remote git clone via single command
View sync.sh
#!/bin/sh
###########################
cd /c/dev/psy-blog.git
# pushing committed updates first
git push
# standard procedure
git add .
echo type message..
read commitMessage
git commit -am "$commitMessage"
View youtubefilter.js
/*
Userscript to hide youtube's recommended channels from mainpage
root@psychip.net
march 2017
updated 25 May 2017
*/
setTimeout(function() {
$(document).ready(function() {
$('span')
View keybase.md

Keybase proof

I hereby claim:

  • I am psychip on github.
  • I am psychip (https://keybase.io/psychip) on keybase.
  • I have a public key whose fingerprint is 1600 0ECF A507 E1E5 705E F4E2 3EC1 1897 E5E2 20CE

To claim this, I am signing this object:

@PsyChip
PsyChip / class.psyutil.php
Created Jul 2, 2016
my private php utilities which used in previously involved web projects. no documentation but it's worth to take a look.
View class.psyutil.php
<?php
# PsyUtils - Generic web toolkit for php 5.4+
# Armagan Corlu aka PsyChip
# root@psychip.net
# March 2014
$psy_mimetypes = [
'cpt' => 'application/mac-compactpro',
'bin' => 'application/macbinary',
View app.js
/* global os */
var request = require('sync-request/index.js');
var raspi = require("raspi");
var conf = {
server: "192.168.1.125",
port: "8484",
devid: "200616-004",
debug: true,
View libraspi.js
/*
Raspberry pi toolkit for node.js
depends on sync runner library (npm install sync-runner)
functions:
getThrm(): returns cpu temperature
getVcc(): returns total used voltage by soc unit
uptime(): system uptime in milliseconds
serviceStart(): starts a system daemon, call serviceStop() to do opposite