Skip to content

Instantly share code, notes, and snippets.

SLEEPSECONDS=5
HOTPROC=ffmpeg
MAXHEAT=71
COOLDOWNTEMP=45
#TODO: ENSURE ONLY 1 PROCESS OF HOTPROC IS RUNNING
while pgrep $HOTPROC > /dev/null; do
sleep $SLEEPSECONDS
# getting temp of cpu
CORETEMP=$(sensors | grep 'Core 0')
CELCLINE=${CORETEMP#*+}
;;remove top menu bar that nobody has ever clicked
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
(menu-bar-mode -1)
;; move multiple windows with shortcuts
@zvakanaka
zvakanaka / chrubuntu_fresh.sh
Created February 11, 2016 00:29
Chromebook Ubuntu
#!/bin/bash
# Install the ussual stuff
#allow adding sources
sudo apt-get install software-properties-common
#avoid conflict
sudo apt-get purge xscreensaver
<?xml version="1.0" encoding="UTF-8"?>
<channel name="xfce4-panel" version="1.0">
<property name="configver" type="int" value="2"/>
<property name="panels" type="array">
<value type="int" value="1"/>
<property name="panel-1" type="empty">
<property name="position" type="string" value="p=4;x=1264;y=743"/>
<property name="plugin-ids" type="array">
<value type="int" value="6"/>
**************vt terminal colors guide***************
cout << "\E[1;31m" << "thick red text!\n";
^
property 1
cout << "\E[0;31m" << "red text!\n";
^^
property 2
//lamepeg lame terminal picture decoder
//made by Adam Quinton 2010
#include <iostream>
#include <fstream>
#include <cstring>
#include <stdlib.h>
#include <unistd.h>
#define RELOAD 18
#define MAXROW 41
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
int main(int argc, char **argv)
{
int i = 0;
int color[] = {31, 33, 32, 34, 35};
char fileName[256];
@zvakanaka
zvakanaka / gmail-smtp.sh
Last active May 3, 2016 04:33
Sets up gmail using SSMTP
#!/bin/bash
#BASH GMAIL SETUP via SSMTP by adam quinton
#Installation instructions:
#wget https://gist.githubusercontent.com/zvakanaka/6a0a23c611be1eccc15639ac3ed441d5/raw/42a97fdb2cdee75fdf6f671d0a91d3d6bc02ee30/gmail-smtp.sh && sudo bash gmail-smtp.sh; rm gmail-smtp.sh
if [ $USER = "root" ]
then
#Sets up gmail using SSMTP
SSMTP_CONFIG="/etc/ssmtp/ssmtp.conf"
#check if ssmtp already installed
@zvakanaka
zvakanaka / redo-iptables.sh
Last active June 17, 2016 14:17
Script to run at reboot for Pi3 Access Point
sudo iptables --flush
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"
sudo service dnsmasq restart
sleep 15
@zvakanaka
zvakanaka / npm-aliases.sh
Last active August 19, 2016 15:11
Node links aliases
NODE_DIR='~/.nvm/versions/node/$(node --version)'
alias links='ls -l $NODE_DIR/lib/node_modules/'
alias mylinks='ls -l node_modules'