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
| # Hold a package | |
| sudo apt-mark hold <package-name> | |
| # Un-hold a package | |
| sudo apt-mark unhold <package-name> | |
| # Show all packages on-hold | |
| sudo apt-mark showhold |
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
| As always, make sure you have a backup of your data. | |
| Since we're going to modify the partition table there's a chance it could be corrupted or lost. | |
| Run 'sudo fdisk /dev/sda'. | |
| Use 'p' to list the partitions. | |
| Make note of the start cylinder of /dev/sda1. | |
| Use 'd' to delete the /dev/sda1 partition. |
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
| ... | |
| stream { | |
| upstream ssh { | |
| server localhost:22; | |
| } | |
| server { | |
| listen 80; |
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
| #SSH Config File Cheat Sheet | |
| ## Exmaple | |
| Host {{Shortcut Alias}} | |
| HostName {{FQDN, Hostname or IP}} | |
| User {{Username}} | |
| Port {{Port Number}} | |
| IdentityFile ~/.ssh/id_rsa | |
| ##Understanding ~/.ssh/config entries |
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
| ##Via apt | |
| curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - | |
| echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list | |
| sudo apt update | |
| sudo apt install yarn | |
| ##Via npm | |
| npm install --global yarn |
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
| ((http|https|ftp|sftp)?:\/\/?\S*?\.onion?[^\s]+.*?) |
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
| import mmap | |
| import os | |
| def file_last(file, count): | |
| with open("log.txt") as log: | |
| end = last_pos = os.stat("log.txt").st_size | |
| lines = [] | |
| with mmap.mmap(log.fileno(), 0, access=mmap.ACCESS_READ) as mm: | |
| while last_pos != -1: |
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
| function comDiviser(numOne, numTwo) { | |
| let maxNum = Math.max(numOne, numTwo); | |
| let maxComDiviser = 0; | |
| for (let i = 1; i <= maxNum; i++) { | |
| maxComDiviser = (numOne%i==0 && numTwo%i==0 && i>maxComDiviser) ? i : maxComDiviser; | |
| } |
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
| MaxCircuitDirtiness NUM |
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
| function combinations(str) { | |
| var fn = function(active, rest, a) { | |
| if (!active && !rest) | |
| return; | |
| if (!rest) { | |
| a.push(active); | |
| } else { | |
| fn(active + rest[0], rest.slice(1), a); | |
| fn(active, rest.slice(1), a); | |
| } |
OlderNewer