Skip to content

Instantly share code, notes, and snippets.

@biji
biji / after_resume.txt
Created April 30, 2017 14:55
tlp resume issue
--- TLP 0.9 --------------------------------------------
+++ Configured Settings: /etc/default/tlp
TLP_ENABLE=1
TLP_DEFAULT_MODE=AC
DISK_IDLE_SECS_ON_AC=0
DISK_IDLE_SECS_ON_BAT=2
MAX_LOST_WORK_SECS_ON_AC=15
MAX_LOST_WORK_SECS_ON_BAT=60
CPU_SCALING_GOVERNOR_ON_AC=powersave
@biji
biji / f.php
Last active March 15, 2018 09:33
<?php
function getUser(): User
{
//...
}
$a = getUser();
$a-> // PRESS CTRL-SPACE TO AUTO COMPLETE
@biji
biji / ssd-check.sh
Last active November 15, 2019 04:12
Check how many GB written to your SSD
#!/bin/sh
TOTALGB=`echo "scale=2; $(sudo /usr/sbin/smartctl -A /dev/sda | grep "Total_LBAs_Written" | awk '{print $10}') * 512 / 1073741824" | bc`
echo "$TOTALGB GB written"
@biji
biji / konvert.sh
Created September 30, 2020 11:49
Convert many svgz in folders to pdf
for DIR in */; do
if [ -f "$DIR" ]
then
continue
fi
BASENAME=`basename "$DIR"`
echo "$DIR"
mkdir -p "$DIR/pdf"
MAX=0
for a in `seq 1 500`; do
@biji
biji / suspendtime.sh
Created July 7, 2022 02:56
Calculate suspend time from systemd's journalctl
#!/bin/bash
# NAME: suspendtime
# PATH: $HOME/askubuntu/
# DESC: For: https://askubuntu.com/questions/321855/how-to-get-real-uptime
# DATE: November 6, 2019.
# NOTE: Calculate suspend time from systemd's journalctl
# UPDT: