This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // It's tested on ios 8.2 .. | |
| // Apple document about virtual memory: | |
| // Both OS X and iOS include a fully-integrated virtual memory system that you cannot turn off; it is always on. | |
| // https://developer.apple.com/library/mac/documentation/Performance/Conceptual/ManagingMemory/Articles/AboutMemory.html | |
| // Discussing mmap on ios: | |
| // http://stackoverflow.com/questions/13425558/why-does-mmap-fail-on-ios | |
| // http://stackoverflow.com/questions/9184773/is-there-a-practical-limit-on-the-number-of-memory-mapped-files-in-ios | |
| #include <sys/mman.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Use: | |
| NSURLSessionConfiguration:backgroundSessionConfiguration: | |
| instead of | |
| NSURLSessionConfiguration:defaultSessionConfiguration | |
| From the NSURLSessionConfiguration:backgroundSessionConfiguration: documentation: | |
| Upload and download tasks in background sessions are performed by an external daemon instead of by the app itself. As a result, the transfers continue in the background even if the app is suspended, exits, or crashes. | |
| So in your case, change: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Set variables in .bashrc file | |
| # don't forget to change your path correctly! | |
| export GOPATH=$HOME/golang | |
| export GOROOT=/usr/local/opt/go/libexec | |
| export PATH=$PATH:$GOPATH/bin | |
| export PATH=$PATH:$GOROOT/bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Linux sysctl.conf setting changes: | |
| # Technologies suggested buffer settings | |
| net.core.rmem_max = 16777216 | |
| net.core.wmem_max = 16777216 | |
| net.core.rmem_default = 8388608 | |
| net.core.wmem_default = 8388608 | |
| net.core.netdev_max_backlog = 3145728 | |
| net.ipv4.tcp_window_scaling = 0 | |
| net.ipv4.route.secret_interval = 86400 | |
| net.ipv4.tcp_rmem = 262144 4194304 16777216 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git config --global https.proxy http://127.0.0.1:1080 | |
| git config --global https.proxy https://127.0.0.1:1080 | |
| git config --global --unset http.proxy | |
| git config --global --unset https.proxy | |
| npm config delete proxy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ############################################################################### | |
| # Helpful Docker commands and code snippets | |
| ############################################################################### | |
| ### CONTAINERS ### | |
| docker stop $(docker ps -a -q) #stop ALL containers | |
| docker rm -f $(docker ps -a -q) # remove ALL containers | |
| docker rm -f $(sudo docker ps --before="container_id_here" -q) # can also filter | |
| # exec into container |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| net.ipv4.ip_forward = 1 | |
| net.ipv4.conf.all.send_redirects = 0 | |
| net.ipv4.conf.default.send_redirects = 0 | |
| net.ipv4.conf.eth0.send_redirects = 0 | |
| net.ipv4.conf.lo.send_redirects = 0 | |
| net.ipv4.conf.all.accept_redirects = 0 | |
| net.ipv4.conf.default.accept_redirects = 0 | |
| net.ipv4.conf.eth0.accept_redirects = 0 | |
| net.ipv4.conf.lo.accept_redirects = 0 | |
| net.ipv4.tcp_fastopen = 0x403 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #printf | |
| RUN printf '#!/bin/bash\n\ | |
| echo hello world from line 1\n\ | |
| echo hello world from line 2'\ | |
| >> /tmp/hello | |
| #echo | |
| RUN echo -e '#!/bin/bash\n\ | |
| echo hello world from line 1\n\ | |
| echo hello world from line 2'\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git config --global diff.tool bbdiff | |
| git config --global difftool.bbdiff.cmd 'bbdiff --wait --resume "$LOCAL" "$REMOTE"' | |
| git config --global difftool.prompt false | |
| git config --global merge.tool bbdiff | |
| git config --global mergetool.bbdiff.cmd 'bbdiff --wait --resume "$LOCAL" "$REMOTE"' | |
| Double check ~/.gitconfig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # vim style tmux config | |
| # use C-a, since it's on the home row and easier to hit than C-b | |
| set-option -g prefix C-a | |
| unbind-key C-a | |
| bind-key C-a send-prefix | |
| set -g base-index 1 | |
| # Easy config reload | |
| bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded." |