Updated: 2024-04-02
Table Of Contents
- Updated: 2024-04-02
- Create User – Linux systems
- Install zsh and ohmyzsh
- Install web browsers
- To zip folder
- To unzip the zip file
- Web server on demand
- SASS watch commands
- SCP – Copy files over SSH
- Folder Size command
- Restart IIS
- Mount network drive
- Create user and add it to admin group
- Auto time stamp in notepad
- Time sync Windows Server command
- Enable Remote Desktop
- Windows Control Panel commands
- Boot into BIOS/UEFI
Create User – Linux systems
useradd -G sudo -m [username] -s /bin/bash
passwd [username]
Install zsh and ohmyzsh
sudo apt update
sudo apt upgrade
sudo apt install zsh
sudo apt install git
download and install
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
Folder Size command
$ du -sh file_path
Restart IIS
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.
Mount network drive
net use * \\server\share [password] /user:[domain\]username
example:
net use * \\192.168.1.5\backup veryStrongPassword /user:alex /persistent:yes
Create user and add it to admin group
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 saving the file, notepad will put a timestamp 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
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
Windows Control Panel commands
# WIN + R
control userpassword2
# Windows Default application
computerdefaults
# Fonts Clear Type Tune
cttune
# DirectX diagnostic tool
dxdiag
# Disk utilities management
diskmgmt.msc
# Microsoft config
msconfig
# Information panel
msinfo32
# Power panel
powercfg.cpl
# Steps Recorder
psr
# Windows version
winver
# Network connection center
ncpa.cpl
# Time and Time zone control panel
timedate.cpl
# Application control panel (add and remove programs)
appwiz.cpl
Boot into BIOS/UEFI
# make a shortcut on Windows
cmd.exe /k shutdown /r /fw /t 1