Skip to content

Instantly share code, notes, and snippets.

View BreiteSeite's full-sized avatar

micha BreiteSeite

View GitHub Profile
@beddari
beddari / install_vagrant_sudoers.sh
Created December 13, 2011 12:47
Allow Vagrant sudo-access without password for NFS-setup
#!/bin/bash
# Script for placing sudoers.d files with syntax-checking
if [ -z "$1" ]; then
# Making a temporary file to contain the sudoers-changes to be pre-checked
TMP=$(mktemp)
cat > $TMP <<EOF
Cmnd_Alias VAGRANT_EXPORTS_ADD = /bin/su root -c echo '*' >> /etc/exports
Cmnd_Alias VAGRANT_NFSD = /etc/init.d/nfs-kernel-server restart
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /bin/sed -e /*/ d -ibak /etc/exports
@jboner
jboner / latency.txt
Last active May 24, 2024 16:18
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@sindresorhus
sindresorhus / git-dirty-checks.md
Created October 16, 2012 11:20
Benchmark results of the fastest way to check if a git branch is dirty

Tested against the WebKit git repo by entering the repo with 1 file dirty.


git diff --quiet --ignore-submodules HEAD # Will tell if there are any uncomitted changes, staged or not.
0.6 sec

git diff-index --quiet HEAD # Only tracked
2 sec

@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@christianchristensen
christianchristensen / jenkins.yml.md
Last active February 2, 2017 18:05
.jenkins.yml research and thoughts

.jenkins.yml

Build configuration(s) closer to code; inspired by .travis.yml

  • Default yaml file to define a build that runs make test
  • Preserves No State Between Builds (runs all commands over SSH in isolated virtual machines)
  • The standard Unix exit code of "0" means the build passed; everything else is treated as failure.
  • Specify branches to build (whitelist, blacklist)
  • Secure environment variables (keys, configuration, ...)
@abhishekkr
abhishekkr / README.md
Last active January 22, 2016 19:26
ArchLinux Bootstrap Script [non-UEFI]

Using it

Check for Internet connectivity, get that working.

Then run "pre_arch_chroot.sh" with manual UEFI mods if required. This will ask some confirmations, give it.

And obviously these scripts have my name for 'username', so run following command on both scripts before using.

sed -i 's/abhishekkr/$YOUR_USER_NAME/g' post_arch_chroot.sh
@zQueal
zQueal / awesome-php.md
Last active December 16, 2019 18:39 — forked from ziadoz/awesome-php.md
@staltz
staltz / introrx.md
Last active May 24, 2024 07:56
The introduction to Reactive Programming you've been missing
@andrewwebber
andrewwebber / coreos-router.yaml
Last active May 3, 2018 06:06
CoreOS - Router
#cloud-config
coreos:
units:
- name: sshd.socket
command: restart
content: |
[Socket]
ListenStream=2222
Accept=yes
@dwrobel
dwrobel / gist:266ad5d4e59b05ea26d8bb6725118578
Last active April 4, 2024 00:36
Updating Raspberry Pi 4 bootloader EEPROM on Fedora
# Update EEPROM on Raspberry Pi 4
# Tested on Fedora Server 36 with downstream kernel (see https://rpmfusion.org/Howto/RaspberryPi for more information)
# Author: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
# Install git and strings utilities
$ sudo dnf install /usr/bin/git /usr/bin/strings
# Clone the repository
$ git clone https://github.com/raspberrypi/rpi-eeprom.git && cd rpi-eeprom/