Skip to content

Instantly share code, notes, and snippets.

View anirudh-ramesh's full-sized avatar
🏁
pongal-o-pongal

Anirudh Ramesh anirudh-ramesh

🏁
pongal-o-pongal
View GitHub Profile
@anirudh-ramesh
anirudh-ramesh / info.sh
Created April 6, 2023 11:52
JBM TrakMate
lsusb
ls /dev/ttyUSB?
ifconfig -a
ssh -oHostKeyAlgorithms=+ssh-rsa root@192.168.2.2
config get TCU500
qca9377 wifi ap start
echo 1 > /sys/class/gpio/gpio24/value
cm info
version: "3.4"
# ------------------------------------------------------------------
# This runs your local FlexMeasures code in a docker compose stack.
# Two FlexMeasures instances are spun up, one for serving the web
# UI & API, one to work on computation jobs.
# The server is adding a toy account when it starts.
# (user: toy-user@flexmeasures.io, password: toy-password)
#
# Instead of local code (which is useful for development purposes),
@anirudh-ramesh
anirudh-ramesh / firefox.log
Last active February 23, 2023 05:25
Keycloak
security.fileuri.strict_origin_policy
@anirudh-ramesh
anirudh-ramesh / _backup_restore.sql
Last active July 9, 2023 05:54
Clean Irasus data
SET statement_timeout TO 1200000;
--
\COPY (SELECT * FROM "traccar"."tc_devices" ORDER BY "id" ASC) TO '/goodenough_0/devices.csv' WITH CSV DELIMITER ',' HEADER QUOTE '"' ESCAPE '''';
\COPY (SELECT * FROM "traccar"."tc_users" ORDER BY "id" ASC) TO '/goodenough_0/users.csv' WITH CSV DELIMITER ',' HEADER QUOTE '"' ESCAPE '''';
\COPY (SELECT * FROM "traccar"."tc_positions" ORDER BY "id" ASC) TO '/goodenough_0/positions.csv' WITH CSV DELIMITER ',' HEADER QUOTE '"' ESCAPE '''';
--
@anirudh-ramesh
anirudh-ramesh / clean__journal.sh
Last active March 14, 2023 09:56
Clean Snap packages
# journalctl --disk-usage
journalctl --vacuum-size=50M
journalctl --vacuum-time=10d
echo SystemMaxUse=500M | tee -a /etc/systemd/journald.conf
@anirudh-ramesh
anirudh-ramesh / Node-RED_file_upload.json
Created June 19, 2021 11:39 — forked from natcl/Node-RED_file_upload.json
Node-RED file upload example with built-in http in node.
[
{
"id": "f1ffeb7e.f6451",
"type": "http in",
"z": "c29865fe.249648",
"name": "",
"url": "/upload",
"method": "get",
"upload": false,
"swaggerDoc": "",
@anirudh-ramesh
anirudh-ramesh / winbattery.py
Created November 16, 2020 16:55
Win Battery using WMI
import wmi
c = wmi.WMI()
t = wmi.WMI(moniker = "//./root/wmi")
batts1 = c.CIM_Battery(Caption = 'Portable Battery')
for i, b in enumerate(batts1):
print 'Battery %d Design Capacity: %d mWh' % (i, b.DesignCapacity or 0)
@anirudh-ramesh
anirudh-ramesh / readCookies.py
Created September 29, 2019 17:09
Read Cookies
#!/usr/bin/env python
import os
import sqlite3
import pwd
_cookieName = "preferredLanguage"
def getPreferredLanguageFromCookieDB():
retval="en-US"
cookieDBFilename = os.path.join(pwd.getpwuid(1000).pw_dir, ".config/google-chrome/Default/Cookies")
@anirudh-ramesh
anirudh-ramesh / rename_serialize.sh
Last active October 4, 2019 09:59
Library of Shell scripts
ls -v | cat -n | while read n f; do mv -n "$f" "$n.png"; convert "$n.png" "$n.pdf"; done
Move a group of components around a schematic:
move (>0 0) (0 -0.5);
Generate statistics of a board:
run length-freq-ri
Smash all & Change the typeface, ratio, and size of all elements:
group all; smash (> 0 0); change font vector (>0 0); change ratio 8 (>0 0); change size 0.07 (>0 0);