Skip to content

Instantly share code, notes, and snippets.

Peleg Michaeli pelegm

Block or report user

Report or block pelegm

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
pelegm / memory
Created May 26, 2015
Show system memory
View memory
sudo lshw -short -c memory
View kernel-version
uname -r
pelegm / ldiff
Last active Aug 29, 2015
colorized unified paged diff
View ldiff
diff -u $1 $2 |\
sed 's/^-/\x1b[31m-/;s/^+/\x1b[32m+/;s/^@/\x1b[34m@/;s/$/\x1b[0m/' |\
View ubuntu-codename
import lsb_release
print lsb_release.get_lsb_information()['CODENAME']
pelegm / ubuntu-architecture
Created Apr 11, 2015
View ubuntu-architecture
## Credit: Cristiana Nicolae
## Source:
getconf LONG_BIT
View ubuntu-description
import lsb_release
print lsb_release.get_lsb_information()['DESCRIPTION']
pelegm / ubuntu-version
Last active Aug 29, 2015
View ubuntu-version
import lsb_release
print lsb_release.get_lsb_information()['RELEASE']
View bios-version
## Credit: sdennie
## Source:
sudo dmidecode -s bios-version
pelegm / git-repo-size
Created Mar 31, 2015
Get git repo size
View git-repo-size
# Credit:
git bundle create tmp.bundle --all && du -sh tmp.bundle && rm tmp.bundle
View round.go
package main
import (
func Round(val float64, roundOn float64, places int ) (newVal float64) {
var round float64
pow := math.Pow(10, float64(places))
You can’t perform that action at this time.