This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit | |
fi | |
trap finish EXIT | |
get_dirty () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/fatih/color" | |
"io/ioutil" | |
) | |
var ( | |
fileColor = color.New(color.FgCyan) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/gokrazy/gokrazy" | |
"log" | |
"net/http" | |
"path/filepath" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Get Polybar ID | |
id=$(xdo id -N "Polybar") | |
# If Polybar is viewable hide it. Otherwise, show it. | |
if xwininfo -id $id | grep -q "IsViewable"; then | |
xdo hide -N "Polybar" | |
else | |
xdo show -N "Polybar" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import time | |
import os | |
dirty_data_path = "/sys/block/bcache0/bcache/dirty_data" | |
writeback_path = "/sys/block/bcache0/bcache/writeback_percent" | |
def get_writeback(): | |
with open(writeback_path, 'r') as f: | |
return int(f.read()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PACKAGE=${1#*//} | |
go get $PACKAGE |