Skip to content

Instantly share code, notes, and snippets.

View lagergren's full-sized avatar

Marcus Lagergren lagergren

View GitHub Profile
@tdd
tdd / gitconfig.ini
Last active April 16, 2025 03:24
Nice, useful global Git configuration
# Put this in your ~/.gitconfig or ~/.config/git/config
# Windows users: "~" is your profile's home directory, e.g. C:\Users\<YourName>
[user]
name = Your Full Name
email = [email protected]
[color]
# Enable colors in color-supporting terminals
ui = auto
[alias]
# List available aliases
@Daeinar
Daeinar / gist:4383663
Created December 26, 2012 22:34
Install pip packages with homebrew
Install pip packages with homebrew:
1. Install Homebrew
http://mxcl.github.com/homebrew/
2. Install the brew-pip package
brew install brew-pip
3. Add Homebrew's pip path to your PYTHONPATH environment variable (you probably should add this to some sort of shell initialization file like ~/.bashrc or ~/.zshrc)
export PYTHONPATH=$(brew --prefix)/lib/python2.7/site-packages
3. Now install any pip pacakges with Homebrew!
brew pip Glances
@bandwidthcrunch
bandwidthcrunch / git.txt
Created February 14, 2013 08:41
git cheatsheet
Downloading the latest stable tree
First, checkout the stable kernel git repository:
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
cd linux-stable
Next, find the latest stable kernel tag by running
git tag -l | less
Find the latest stable kernel by looking for the largest vX.Y.Z values. For example, use the v3.1 tag over the v3.0.46 tag. If v3.1.1 is available, use that instead of v3.1. The kernel tags that end with -rcX are release candidate kernels, not stable kernels.
@vlsi
vlsi / HotspotAllocationProfilerTest output
Created April 12, 2015 13:44
HotspotAllocationProfilerTest output
# Run complete. Total time: 00:00:05
Benchmark Mode Cnt Score Error Units
HotspotAllocationProfilerTest.allocateObject avgt 4,297 ns/op
HotspotAllocationProfilerTest.allocateObject:·allocated avgt 16,002 B/op
HotspotAllocationProfilerTest.allocateObject:·allocation.rate avgt 3202,343 MB/sec
HotspotAllocationProfilerTest.allocateObjectSampleTime sample 15583 56,291 ± 3,064 ns/op
HotspotAllocationProfilerTest.allocateObjectSampleTime:·allocated sample 16,001 B/op
HotspotAllocationProfilerTest.allocateObjectSampleTime:·allocation.rate sample 1941,053 MB/sec
HotspotAllocationProfilerTest.allocateObjectSingleShot ss 5 1287,800 ± 302,336 ns/op
@eyecatchup
eyecatchup / git-commit-log-stats.md
Last active April 11, 2025 08:16
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@GaryLee
GaryLee / Dockerfile
Last active October 22, 2022 19:39
Dockerfile to create CENTOS7 with ssh server and x11 server.
FROM centos:centos7
MAINTAINER Gary Lee <[email protected]>
# Install ssh server.
RUN yum install -y which openssh-clients openssh-server
RUN ssh-keygen -f /etc/ssh/ssh_host_rsa_key
RUN ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
RUN sed -i '/pam_loginuid.so/c session optional pam_loginuid.so' /etc/pam.d/sshd
# Set root's password
@lenchevsky
lenchevsky / Dockerfile
Created February 2, 2017 20:14
Dockerfile for CentOS 7 with enabled systemd, sshd and deployed ssh keys
FROM centos/systemd
MAINTAINER Oleg Snegirev <[email protected]>
# Install packages
RUN yum -y install openssh-server sudo nano epel-release openssl certmonger; systemctl enable sshd.service
# Enable root and pos accounts
RUN echo 'root:33103255235331325230' | chpasswd
RUN adduser pos && \
@jamesfreeman959
jamesfreeman959 / keepawake.ps1
Last active May 5, 2025 06:41
A very simple PowerShell script to keep a Windows PC awake and make lync think the user is active on the keyboard
# Useful references:
#
# https://superuser.com/questions/992511/emulate-a-keyboard-button-via-the-command-line
# https://ss64.com/vb/sendkeys.html
# https://social.technet.microsoft.com/Forums/windowsserver/en-US/96b339e2-e9da-4802-a66d-be619aeb21ac/execute-function-one-time-in-every-10-mins-in-windows-powershell?forum=winserverpowershell
# https://learn-powershell.net/2013/02/08/powershell-and-events-object-events/
#
# Future enhancements - use events rather than an infinite loop
$wsh = New-Object -ComObject WScript.Shell
while (1) {
@RabaDabaDoba
RabaDabaDoba / ANSI-color-codes.h
Last active May 8, 2025 10:34 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes working in C!
/*
* This is free and unencumbered software released into the public domain.
*
* For more information, please refer to <https://unlicense.org>
*/
//Regular text
#define BLK "\e[0;30m"
#define RED "\e[0;31m"
#define GRN "\e[0;32m"
@erdincay
erdincay / sugh.sh
Last active March 28, 2025 16:44
su GitHub (downloading all repositories from a given user)
#!/bin/bash
if [ -z "$1" ]; then
echo "waiting for the following arguments: username + max-page-number"
exit 1
else
name=$1
fi
if [ -z "$2" ]; then