most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat| # Copyright (c) 2010, Luca Antiga, Orobix Srl. | |
| # All rights reserved. | |
| # | |
| # Redistribution and use in source and binary forms, with or without | |
| # modification, are permitted provided that the following conditions are | |
| # met: | |
| # | |
| # * Redistributions of source code must retain the above copyright | |
| # notice, this list of conditions and the following disclaimer. | |
| # |
| // | |
| // Regular Expression for URL validation | |
| // | |
| // Author: Diego Perini | |
| // Created: 2010/12/05 | |
| // Updated: 2018/09/12 | |
| // License: MIT | |
| // | |
| // Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
| // |
rsync (Everyone seems to like -z, but it is much slower for me)
| // Check Iranian National Code Validity - Clojure, C#, F#, Ruby, JavaScript, Dart, Python, Scala, Java 8, PHP, C, Go, Swift, Kotlin, Groovy, Rust, Haskell, Erlang, Elixir, Power Query M Language, VBA, R, Lua, Fortran, Pascal/Delphi, Excel, Stored Procedure / MySQL | |
| // بررسی صحت کد ملی ایران - کلوژر، سیشارپ، افشارپ، روبی، جاوااسکریپت، دارت، پایتون، اسکالا، جاوا ۸، پیاچپی، سی، گو، سوئیفت، کاتلین، گرووی، راست، هسکل، ارلنگ، الکسیر، پاورکوئری ام، ویبی ای، آر، لوآ، فرترن، پاسکال/دلفی، اکسل، مایاسکیوال | |
| // در نسخههای قبل یکسان بودن اعداد نا معتبر تشخیص داده میشد ولی | |
| // اعداد یکسان نامعتبر نیست https://web.archive.org/web/20170706081048/http://www.fardanews.com/fa/news/127747/رندترین-شماره-ملی-بلای-جان-صاحبش-شد | |
| // بعضی از پیادهسازیها سریع نیستند، میتوانید نسخهٔ خود را بر پایهٔ | |
| // نسخهٔ سی یا گو ایجاد کنید که بهترین سرعت را داشته باشد | |
| /** |
| #!/usr/bin/env bash | |
| set -o errexit | |
| set -o nounset | |
| set -o pipefail | |
| # Automatically update your CloudFlare DNS record to the IP, Dynamic DNS | |
| # Can retrieve cloudflare Domain id and list zone's, because, lazy | |
| # Place at: | |
| # /usr/local/bin/cf-ddns.sh |
| # Install ARCH Linux with encrypted file-system and UEFI | |
| # The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description. | |
| # Download the archiso image from https://www.archlinux.org/ | |
| # Copy to a usb-drive | |
| dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux | |
| # Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration. | |
| # Set swedish keymap |
| #!/bin/sh | |
| # dependencies | |
| echo "Installing dependencies via Homebrew (http://brew.sh)" | |
| ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" | |
| brew update | |
| brew install gcc48 |
| # Basic Strongswan ikev2 server setup | |
| * paltform: atlantic.net ubuntu 14.04 x64 | |
| * the commands below are run with root account | |
| ## Strongswan | |
| ``` | |
| apt-get install strongswan | |
| apt-get install iptables iptables-persistent | |
| ``` |
| # configure proxy for git while on corporate network | |
| # From https://gist.github.com/garystafford/8196920 | |
| function proxy_on(){ | |
| # assumes $USERDOMAIN, $USERNAME, $USERDNSDOMAIN | |
| # are existing Windows system-level environment variables | |
| # assumes $PASSWORD, $PROXY_SERVER, $PROXY_PORT | |
| # are existing Windows current user-level environment variables (your user) | |
| # environment variables are UPPERCASE even in git bash |