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
pelegm / memory
Created May 26, 2015
Show system memory
View memory
#!/bin/sh
sudo lshw -short -c memory
View kernel-version
#!/bin/sh
uname -r
@pelegm
pelegm / ldiff
Last active Aug 29, 2015
colorized unified paged diff
View ldiff
#!/bin/sh
diff -u $1 $2 |\
sed 's/^-/\x1b[31m-/;s/^+/\x1b[32m+/;s/^@/\x1b[34m@/;s/$/\x1b[0m/' |\
less
View ubuntu-codename
#!/usr/bin/python
import lsb_release
print lsb_release.get_lsb_information()['CODENAME']
@pelegm
pelegm / ubuntu-architecture
Created Apr 11, 2015
ubuntu-architecture
View ubuntu-architecture
## Credit: Cristiana Nicolae
## Source: http://askubuntu.com/a/352090/221347
getconf LONG_BIT
View ubuntu-description
#!/usr/bin/python
import lsb_release
print lsb_release.get_lsb_information()['DESCRIPTION']
@pelegm
pelegm / ubuntu-version
Last active Aug 29, 2015
ubuntu-version
View ubuntu-version
#!/usr/bin/python
import lsb_release
print lsb_release.get_lsb_information()['RELEASE']
View bios-version
## Credit: sdennie
## Source: http://ubuntuforums.org/showthread.php?t=857399&p=5371479#post5371479
sudo dmidecode -s bios-version
@pelegm
pelegm / git-repo-size
Created Mar 31, 2015
Get git repo size
View git-repo-size
# Credit: http://stackoverflow.com/a/8185326/1565828
git bundle create tmp.bundle --all && du -sh tmp.bundle && rm tmp.bundle
View round.go
package main
import (
"log"
"math"
)
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.