Skip to content

Instantly share code, notes, and snippets.

View YenLegion's full-sized avatar

Bad Vibes YenLegion

View GitHub Profile
@rfunduk
rfunduk / osx.sh
Last active August 27, 2021 15:00 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with useful tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2263406/osx.sh | sh
#
@Capncavedan
Capncavedan / Ruby script
Created April 9, 2012 15:45
Ruby script to show OS X battery info at command line
#!/usr/bin/ruby
ioreg_data = IO.popen("ioreg -w0 -l").readlines().join
ioreg_data.sub!(/.*(\+\-o AppleSmartBattery.*?\+\-o).*/m, '\\1')
ioreg_data.gsub!(/\s+\|/, "")
ioreg_data.gsub!(/\s\s+/, "\n")
battery = Hash.new
ioreg_data.split(/\n+/).each do |line|
key, value = line.split(' = ')[0..1]
next if key.nil? || value.nil?
@zoqaeski
zoqaeski / custom
Created October 12, 2012 18:14
xkbcomp keyboard layout dump
// $XDG_CONFIG_HOME/xkb/symbols/custom
// Makes ALT + CAPS_LOCK act as 3rd level switch
// Works sporadically
partial modifier_keys
xkb_symbols "alt_caps_mode_switch" {
key <CAPS> {
type[Group1]="PC_ALT_LEVEL2",
[ Caps_Lock, ISO_Level3_Shift ]
};
@KartikTalwar
KartikTalwar / Documentation.md
Last active June 25, 2024 10:55
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@dmay-work
dmay-work / SMB-Speed
Last active September 9, 2019 02:21
Speed up Samba (SMB) share access/browsing from Mac OSX
# Disclaimer: Results may vary. May not be suitable/desirable for some setups.
# Tested with Windows network shares and Mountain Lion
# Start your favorite shell app (or Terminal.App in /Applications) and type the following command:
sudo sysctl -w net.inet.tcp.delayed_ack=0
# Create a file called "edu.mit.Kerberos" with the following contents
# and copy it to /Library/Preferences/ (you will need Administrator privileges):
@kjellski
kjellski / sshd_config
Created July 6, 2013 18:59
This is an example real-world sshd_config with a nice little example at the end. A match clause that enables different setting for specific ranges than general settings...
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.
@halilim
halilim / DNS-Switcher.jse
Created September 1, 2013 14:11
Windows DNS Switcher - Switch your DNS resolvers for all network interfaces in Windows from command line.
/**
* Windows DNS Switcher - Don't wear out your mouse trying to change your DNS server adresses.
* @author Halil Ozgur
* @license GPL Licence
*/
var dnsler = [
["Empty (DHCP-Auto)", []],
["OpenDNS", ["208.67.222.222", "208.67.220.220"]],
["Google DNS", ["8.8.8.8", "8.8.4.4"]],
@amorgner
amorgner / fast-firefox
Last active June 30, 2022 20:01
Some config options to make Firefox faster (updated)
Over time, I collected some options to make Firefox really fast.
WARNING! NO WARRANTY, use on your own risk!
If you know what you're doing, go to 'about:config' and edit the listed values accordingly.
Hint: Double-click boolean values to toggle true/false.
###########################
If mouse-wheel scrolling is slow, try
@irazasyed
irazasyed / homebrew-permissions-issue.md
Last active June 14, 2024 17:01
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

sudo chown -R $(whoami) $(brew --prefix)/*