Skip to content

Instantly share code, notes, and snippets.

Benjamin Altpeter baltpeter

Block or report user

Report or block baltpeter

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@baltpeter
baltpeter / UIColor_NSLog
Created May 3, 2014
Use NSLog to output a UIColor
View UIColor_NSLog
CGFloat red, green, blue, alpha;
[color getRed: &red
green: &green
blue: &blue
alpha: &alpha];
NSLog(@"red = %f. Green = %f. Blue = %f. Alpha = %f",
red,
green,
blue,
alpha);
@baltpeter
baltpeter / script.sh
Created Apr 27, 2014
Format and mount new hard drive
View script.sh
#1. Figure out the device name for the new device
fdisk -l
#This will give you output similar to this:
#Disk /dev/sda: 17.2 GB, 17179869184 bytes
#255 heads, 63 sectors/track, 2088 cylinders, total 33554432 sectors
#Units = sectors of 1 * 512 = 512 bytes
#Sector size (logical/physical): 512 bytes / 512 bytes
#I/O size (minimum/optimal): 512 bytes / 512 bytes
View script.sh
find /path/here -name "what to look for"
@baltpeter
baltpeter / script.sh
Created Mar 22, 2014
System Update with apt/aptitude
View script.sh
apt-get update # update repositories first
# then do either
apt-get dist-upgrade
aptitude safe-upgrade # about equiv. to above, safer though
# alternative, doesn't install or uninstall any packages
apt-get upgrade
# reference: http://askubuntu.com/questions/194651/why-use-apt-get-upgrade-instead-of-apt-get-dist-upgrade
@baltpeter
baltpeter / script.sh
Created Mar 22, 2014
Find out system architecture on Unix
@baltpeter
baltpeter / script.sh
Last active Jul 5, 2016
Setting up locale correctly on new Ubuntu/Debian servers
View script.sh
apt-get update # if this is the first boot on e.g. OpenVZ containers
apt-get install language-pack-en
update-locale LANG=en_US.UTF-8
shutdown -rf 0 # reboot to ensure new locale is applied
# when lang is "(undefinded)"; also preferred anyway
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
You can’t perform that action at this time.