My Terminal Command list

Install zsh and ohmyzsh

sudo apt update
sudo apt upgrade
sudo apt install zsh
sudo apt install git
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

or

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Install web browsers

sudo apt install chromium-browser
sudo apt install google-chrome-stable

to zip folder

zip -r my.zip directory

to unzip the zip file

unzip my.zip -d unzip_folder

Web server on demand

/** Python 2 **/
python -m SimpleHTTPServer 8080
/** Python 3 **/
python -m http.server 8080

SASS watch commands

sass --watch main.sass:../../css/main.css
sass --watch style.scss:../style.css --style compressed
mkdir /Volumes/web
mount -t smbfs //username:password@nas01/web /Volumes/web
cd /Volumes/web/demo/multisite/wp-content/themes/csqstarter
sass --watch sass/style.scss:style.css
sass sass/style.scss:style.css

SCP – Copy files over SSH

scp [OPTION] [user@]SRC_HOST:]file1 [user@]DEST_HOST:]file2

example
scp -p file.txt alex@server:~/Desktop/file.txt
scp -p alexadmin@server1:~/Documents/file1.txt alex@server2:~/Desktop/file1.txt

-P Specifies the remote host ssh port.
-p Preserves files modification and access times.
-q Use this option if you want to suppress the progress meter and non-error messages.
-C This option will force scp to compresses the data as it is sent to the destination machine.
-r This option will tell scp to recursively copy directories.Before you Begin

MAC OS X Load FTP

subl /etc/ftpd.conf
sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist

MAC OS X Unload FTP

sudo -s launchctl unload -w /System/Library/LaunchDaemons/ftp.plist

Java Development Kit path

/** JDK 7 **/
/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home
/** JDK 6 **/
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

Windows Server command list

iisreset -noforce

Usage:
iisreset [computername]

/RESTART – Stop and then restart all Internet services.
/START – Start all Internet services.
/STOP – Stop all Internet services.
/REBOOT – Reboot the computer.
/REBOOTONERROR – Reboot the computer if an error occurs when starting, stopping, or restarting Internet services.
/NOFORCE – Do not forcefully terminate Internet services if attempting to stop them gracefully fails.
/TIMEOUT:val – Specify the timeout value ( in seconds ) to wait for a successful stop of Internet services. On expiration of this timeout the computer can be rebooted if the /REBOOTONERROR parameter is specified. The default value is 20s for restart, 60s for stop, and 0s for reboot.
/STATUS – Display the status of all Internet services.
/ENABLE – Enable restarting of Internet Services on the local system.
/DISABLE – Disable restarting of Internet Services on the local system.

net use – mount network drive

net use * \\server\share [password] /user:[domain\]username

example:
net use * \\server\share password /user:alex /persistent:yes

net user – use command to create user

net user username [password] /add [/domain]

net local group administrators username /add

net group "Domain Admins"  username /add /domain

Auto time stamp in notepad

Simply put “.LOG” in the first line, then every time when save the file,
notepad will put a time stamp at the end of the file.

Time sync Windows Server command

@echo off
w32tm /config /manualpeerlist:64.147.116.229 /syncfromflags:MANUAL
w32tm /config /update
w32tm /resync
pause

@echo off
w32tm /config /syncfromflags:manual /manualpeerlist:0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org,3.pool.ntp.org
w32tm /config /update
w32tm /resync
pause

Time Server peer list

Command line enable Remote Desktop

Run cmd as Administrators

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f

Disable Remote Desktop

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f

Enable Windows Firewall Remote Desktop rules

netsh advfirewall firewall set rule group="remote desktop" new enable=Yes

Disable firewall rules

netsh advfirewall firewall set rule group="remote desktop" new enable=No

end

Share on facebook
Share on twitter
Share on pinterest
Share on linkedin
Share on reddit
Share on tumblr
Share on whatsapp
Share on email
Share on print

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top