Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
update_system()
{
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
}
clean_system()
@cpappen
cpappen / update-time.sh
Created April 18, 2016 11:39
update time in ubuntu 16.04
sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"
@cpappen
cpappen / Disable services that you don't need
Last active April 28, 2016 14:58
windows7services.txt
WINDOWS + R > msconfig > services
Bitlocker Drive Encryption Service
Bluetooth Support Service
Computer Brownser
Disk Defragmenter
Fax
HomeGroup Listener
HomeGroup Provider
IP Helper
@cpappen
cpappen / .vimrc
Created May 3, 2016 04:07
GNOME Terminal supports 256 colors, but doesn't advertise its support. You can override vim's autodetection by putting the following in your ~/.vimrc
if $COLORTERM == 'gnome-terminal'
set t_Co=256
endif
There are some you can disable using the unity-tweak-tool.
install:
sudo apt-get update
sudo apt-get install unity-tweak-tool
run:
unity-tweak-tool &
Click on general and turn desktop magnification to off, set texture quality to fast, set window animations to off.
@cpappen
cpappen / gist:8006b53a2e8103d47534201b3a0d5548
Last active June 26, 2016 13:26
Converting antergos to arch
#Removing packages from antergos repository (fish shell)
$ sudo pacman -R (paclist antergos | awk '{print $1}')
# Then editing /etc/pacman.conf to comment out antergos section
# Then updating the system
$ sudo pacman -Syu
@cpappen
cpappen / gist:b91c4f1bf3431f1d3195037432edb172
Last active June 30, 2016 12:32
find when the system was installed on machine
sudo dumpe2fs $(mount | grep 'on \/ ' | awk '{print $1}') | grep 'Filesystem created:'
ls -alct /|tail -1|awk '{print $6, $7, $8}'
@cpappen
cpappen / killevolution
Created August 20, 2016 15:17
kill evolution processes in startup on ubuntu 16.04
# open gnome-session-properties and add this command to start on startup
for pid in $(ps -ef | awk '/evolution/ {print $2}'); do kill -9 $pid; done
require 'benchmark'
n = 500_000
GIGA_SECOND = 10**9
time = Time.utc(2011, 4, 25, 0, 0, 0)
Benchmark.bm do |x|
x.report("with CONST") { for i in 1..n; time + GIGA_SECOND; end }
x.report("no CONST") { for i in 1..n; time + 10**9; end }
@cpappen
cpappen / gist:2fdfaa1bffac856700c20cb016a9ac3f
Created February 18, 2017 21:02
creating sierra usb disk
sudo /Applications/Install\ macOS\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume --applicationpath /Applications/Install\ macOS\ Sierra.app