- Restart service:
sudo systemctl restart nginx - Change owner:
chown username filename - Change permissions:
chmod ugo+rwx foldername(U - user, g - group, o - other) - Remove package with its config files:
apt-get purge vsftpd - Generate new SSh keys:
ssh-keygen -t rsa -b 4096 -C "[email protected]" - Check user groups:
groups username - Add user to group:
gpasswd -a group usernameremove:gpasswd -d group username
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
| // Basic Types | |
| let id: number = 5 | |
| let company: string = 'Traversy Media' | |
| let isPublished: boolean = true | |
| let x: any = 'Hello' | |
| let ids: number[] = [1, 2, 3, 4, 5] | |
| let arr: any[] = [1, true, 'Hello'] | |
| // Tuple |
More info here
- Run command as user:
sudo -u user command
This sheet goes along with this SSH YouTube tutorial
$ ssh [email protected]
$ mkdir test
$ cd test
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
| #! /bin/bash | |
| # ECHO COMMAND | |
| # echo Hello World! | |
| # VARIABLES | |
| # Uppercase by convention | |
| # Letters, numbers, underscores | |
| NAME="Bob" | |
| # echo "My name is $NAME" |
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
| apiVersion: v1 | |
| kind: ConfigMap | |
| metadata: | |
| name: 'express-gateway-config' | |
| data: | |
| gateway.config.yml: | | |
| http: | |
| host: '*' | |
| port: 8080 | |
| admin: |
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 Get-RandomHexString { | |
| param($count) | |
| $hex = '012345679ABCDEF'.ToCharArray() | |
| $array = foreach($number in 1..$count ){ $hex | Get-Random} | |
| return (($array) -join "").ToString().ToLower() | |
| } | |
| function Get-WikiType{ | |
| param($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
| " Don't try to be vi compatible | |
| set nocompatible | |
| " Helps force plugins to load correctly when it is turned back on below | |
| filetype off | |
| " TODO: Load plugins here (pathogen or vundle) | |
| " Turn on syntax highlighting | |
| syntax on |
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
| # I book marked some sites with useful Linux commands i found. | |
| # then i noticed they were down, so i loaded them via google cache, and copied here. | |
| # source: http://blog.urfix.com/ | |
| # source: http://www.pixelbeat.org/cmdline.html | |
| # Enjoy! | |
| # How to run process as background and never die | |
| # | |
| # nohup means: Do not terminate this process even when the stty is cut off. | |
| # > /dev/null means: stdout goes to /dev/null (which is a dummy device that does not record any output). |