Remember:
- Replace double precentages with single precentage if you want to use it in CMD directly.
- When file names are printed out, they already include double quotes.
@echo off
| import java.time.Duration; | |
| import java.util.List; | |
| import java.util.concurrent.locks.ReentrantLock; | |
| import java.util.stream.IntStream; | |
| import java.util.stream.Stream; | |
| /** | |
| * Demonstrate potential for deadlock on a {@link ReentrantLock} when there is both a synchronized and | |
| * non-synchronized path to that lock, which can allow a virtual thread to hold the lock, but | |
| * other pinned waiters to consume all the available workers. |
| import sys | |
| import pprint | |
| import struct | |
| import socket | |
| import ssl | |
| from time import sleep | |
| # Standard "HELLO" message for TDS | |
| prelogin_msg = bytearray([ 0x12, 0x01, 0x00, 0x2f, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x06, 0x01, 0x00, 0x20, | |
| 0x00, 0x01, 0x02, 0x00, 0x21, 0x00, 0x01, 0x03, 0x00, 0x22, 0x00, 0x04, 0x04, 0x00, 0x26, 0x00, |
| # Install tmux 2.8 on Centos | |
| # install deps | |
| yum install gcc kernel-devel make ncurses-devel | |
| # cd src | |
| cd /usr/local/src | |
| # DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL | |
| curl -LO https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz |
| parse_git_branch() { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
| } | |
| PS1='${debian_chroot:+($debian_chroot)}\[\033[1;31m\]\u\[\033[1;37m\]@\[\033[1;32m\]\h\[\033[1;37m\]:\[\033[1;36m\]\w \[\033[1;35m\]$(parse_git_branch) \[\033[1;33m\]\$ \[\033[0m\]' |
| export PS1='$(git branch &>/dev/null; if [ $? -eq 0 ]; then \ | |
| echo "\[\e[0;32m\][GIT: \[\e[0;31m\]$(basename `pwd`); \[\e[0;33m\]$(git branch | grep ^*|sed s/\*\ //) \ | |
| $(echo `git status` | grep "nothing to commit" > /dev/null 2>&1; if [ "$?" -eq "0" ]; then \ | |
| echo "\[\e[0;32m\]clean"; else \ | |
| echo "\[\e[0;31m\]dirty"; fi)\[\e[0;32m\]] \$ "; else \ | |
| echo "\[\e[0;31m\][\w]\[\e[m\] \$ "; fi) \[\e[0m\]' |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
| #!/bin/bash | |
| ### ABOUT: See: http://gist.github.com/366269 | |
| ### Runs rsync, retrying on errors up to a maximum number of tries. | |
| ### On failure script waits for internect connection to come back up by pinging google.com before continuing. | |
| ### | |
| ### Usage: $ ./rsync-retry.sh source destination | |
| ### Example: $ ./rsync-retry.sh user@server.example.com:~/* ~/destination/path/ | |
| ### | |
| ### INPORTANT: |