Sometimes, you need to quickly dump a json file into sqlite, just to run some queries on it. This is a two-step process:
cat file.json | jq -r '.data | map([.field1, .field2, .field3] | @csv)| join("\n")' > file.csv
#!/bin/bash | |
# | |
# based off https://developer.atlassian.com/blog/2016/02/best-way-to-store-dotfiles-git-bare-repo/ | |
# | |
git clone --bare [email protected]:iAnatoly/homedot.git $HOME/.cfg | |
function config { | |
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@ | |
} | |
config checkout |
# the issue is siimple misconfigurations of gdm3 | |
# the solution is to reinstall it, or better yet - switch to lightdm: | |
sudo apt remove gdm3 && dpkg-reconfigure lightdm | |
# | |
# or reinstall gdm3, it is up to you. |
for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 2 -n -r | less |
# cat > /etc/systemd/wifi-resume.service | |
[Unit] | |
Description=Restart networkmanager at resume | |
After=suspend.target | |
After=hibernate.target | |
After=hybrid-sleep.target | |
[Service] | |
Type=oneshot | |
ExecStart=/bin/systemctl restart network-manager.service |
cp /etc/wpa_supplicant/ifupdown.sh /etc/ifplugd/action.d/ifupdown |
SELECT temp *9/5+32 | |
FROM | |
(SELECT median("temperature") AS "temp" FROM "weather" WHERE $timeFilter GROUP BY time(5m)), | |
(SELECT median("mean_temperature") AS "temp" FROM "year"."weather" WHERE $timeFilter GROUP BY time(1h)) | |
GROUP BY "source" fill(null) |
> CREATE RETENTION POLICY two_days on weather duration 2d replication 1 default | |
> CREATE RETENTION POLICY year on weather duration 52w replication 1 | |
> create continuous query cq_30m on weather BEGIN SELECT mean(*) into year.:MEASUREMENT from two_days./.*/ group by time(30m),* EN |
bpftrace -e 'kprobe:swap_read*,kprobe:swap_write* {@[comm, pid] = count();} interval:s:5{ time(); print(@); clear(@); }' |
for proc in /proc/*; do cat $proc/smaps 2>/dev/null | awk -v proc="${proc}" '/Swap/{swap+=$2/1024}END{if (swap>1) { "readlink "proc"/exe"|getline c; print int(swap+0.5), "\tMB\t", c }}'; done | sort -n |