Skip to content

Instantly share code, notes, and snippets.

@DanielKoohmarey
DanielKoohmarey / check_link.py
Last active August 1, 2021 20:51 — forked from hackerdem/check_link.py
A simple python script to check broken links of a wesite
@adeluccar
adeluccar / gist:d105299f2d5af55e3e96f9b989e7eb48
Created August 8, 2017 22:50
How to Flatten the History of a Git Repository Safely
git checkout --orphan future-master
git add -A  # Add all files and commit them
git commit
git branch -D master  # Deletes the master branch
git branch -m master  # Rename the current branch to master
git push -f origin master  # Force push master branch to github
git gc --aggressive --prune=all     # remove the old files
@jamescookie
jamescookie / setJavaHome.zsh
Last active September 19, 2020 19:37
To switch JAVA_HOME in the current YADR zsh shell on a mac put this file in .zsh.after
function setJavaHome
{
javaVersions=($(/usr/libexec/java_home -V 2>&1 | grep x86 | awk -F ":" '{print $1}' | awk -F "," '{print $1}' | xargs echo -n))
newJava=""
while [[ $newJava = "" ]]; do
echo "Select your Java version for this shell"
select newJava in ${javaVersions[@]}; do
if [[ $newJava = "" ]]; then
echo "Please enter a valid option."
@sveesible
sveesible / pxc_setup.sh
Created September 9, 2015 15:24
A script that attempts to create and configure a percona-xtradb-cluster setup
#!/bin/bash
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Sveesible - PXC-SS - Percona-Xtradb-Cluster-Simple-Setup-Example
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# [Brad Svee] - [07-17-2014] - [PXC-SS] - [1.0]
# ---------------------------------
# [A setup script to help configure a Percona XtraDB MySQL Cluster and Galera]
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
install_percona=true
@wmealing
wmealing / C-states.md
Last active October 8, 2025 11:12
What are CPU "C-states" and how to disable them if needed?

To limit a CPU to a certain C-state, you can pass the processor.max_cstate=X option in the kernel line of /boot/grub/grub.conf.

Here we limit the system to only C-State 1:

    kernel /vmlinuz-2.6.18-371.1.2.el5 ... processor.max_cstate=1

On some systems, the kernel can override the BIOS setting, and the parameter intel_idle.max_cstate=0 may be required to ensure sleep states are not entered: