Skip to content

Instantly share code, notes, and snippets.

View lifeofcoding's full-sized avatar
💭
4RwPdnGala2QfMua

Jimmy Rousseau lifeofcoding

💭
4RwPdnGala2QfMua
View GitHub Profile
@lifeofcoding
lifeofcoding / free-space.sh
Created March 9, 2022 15:30
shell script to delete old files in a directory to free up space
#!/bin/bash
#
# prune_dir - prune directory by deleting files if we are low on space
#
DIR=$1
CAPACITY_LIMIT=$2
if [ "$DIR" == "" ]
then
echo "ERROR: directory not specified"
@lifeofcoding
lifeofcoding / change-brightness.sh
Created July 2, 2020 21:18
Change brightness via command line
#!/bin/bash
# ./change-brghtness.sh 60
newVal=$(printf "%3.2f\n" $(echo "scale=2; $1 / 100" | bc))
sudo ./display-first-instance.sh | xargs -I{} xrandr --output {} --brightness "$newVal"
#!/bin/bash
opacity=$1
sudo sh -c 'xprop -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY $(printf 0x%x $((0xffffffff * '$opacity' / 100)))'
@lifeofcoding
lifeofcoding / make-app-transparent.txt
Created June 19, 2020 02:50
Make App Window Transparent in Ubuntu 18.04, 18.10
sh -c 'xprop -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY $(printf 0x%x $((0xffffffff * 80 / 100)))'
Your mouse cursor will become cross-shaped, simply click on any window and it become 80% opacity.
https://tipsonubuntu.com/2018/11/12/make-app-window-transparent-ubuntu-18-04-18-10/
@lifeofcoding
lifeofcoding / cox-free-wifi.js
Created June 16, 2020 17:29
Cow Wifi Free Trial Bypass
const puppeteer = require("puppeteer");
const sh = require("shelljs");
const random_name = require("node-random-name");
const random_useragent = require("random-useragent");
const fs = require("fs");
const path = require("path");
const randomMac = require("random-mac");
const notifier = require("node-notifier");
const argv = require("yargs")
.option("iface", {
@lifeofcoding
lifeofcoding / Macchangerizer.sh
Last active October 6, 2023 23:26
Unlimited Cox Wifi Free Trial Script
#!/bin/bash
# Macchangerizer.sh script by Manuel Berrueta tweaked by LifeOfCoding
# Use to automate persistence of mac address spoofing
# prior to connecting to WiFi Access Point
# We will stop the network manager service and bring down wlan0,
# so that after the mac address is modified the change can be persistent effect.
# Then we will use macchanger to spoof the mac address of wlan0
# We finish by starting the network manager service and bringing wlan0 back up.
#!/bin/bash
URI=`adb shell pm list packages | grep $1`
ACTIVITY=`adb shell cmd package resolve-activity --brief ${URI#package:} | tail -n 1`
anbox launch --package=${URI#package:} --component=${ACTIVITY//$'/'/}
#!/bin/sh
#
# Script to start CPU limit daemon
#
set -e
case "$1" in
start)
if [ $(ps -eo pid,args | gawk '$3=="/usr/bin/cpulimit_daemon.sh" {print $1}' | wc -l) -eq 0 ]; then
nohup /usr/bin/cpulimit_daemon.sh >/dev/null 2>&1 &
#!/bin/bash
sudo deluser $USER sudo
echo "$USER ALL=NOPASSWD:ALL" | sudo su -c 'cat >> /etc/sudoers'
const EventEmitter = require('events')
const electron = require('electron')
export default class EventBus extends EventEmitter {
constructor(name='default') {
super()
this._name = name
this._baseEventKey = `EventBus-${name}:`
}