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
#Linux Tar usefull commands | |
#-x extract -z typecompression(gz) -v verbose -f use the following tar achive | |
tar -xzvf tarfile.tar.gz #for tar.bz2 or bzip use -xjvf tar.bz2 | |
#extract to specific path -C path | |
tar -xzvf tarfile.tar.gz -C /mypath | |
#extract a single file ; just add the name of the file and the path after the command | |
tar -xzv -f file.tar.gz "./new/abc.text" | |
#extract multiple files | |
tar -xzv -f file.tar.gz "./new/abc.text" "./new/xyz.txt" | |
#extract multiple files using * |
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
#from | |
# https://www.youtube.com/watch?v=LQSMJtckzYI | |
# simple chat coomunication between 2 machines with netcat | |
#This works with linux, Win | |
# to install apt-get install netcat-traditional #buntu | |
#IP 192.168.33.10 | |
nc 192.168.33.10 3137 | |
#IP 192.168.33.11 ; so this machine is listening on the ß0rt 3137 for what 192.168.33.10 is sending, and vicevers | |
nc -l -p 3137 |
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 -l vagrant -i /home/glasslab/.vagrant.d/insecure_private_key 127.0.0.1 -p 2222 |
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
#show all rules in a table ; you can use alternatively -L | |
sudo iptables -S | |
#show rule number in each of the 3 possible cases: INPUT OUTPUT FORWARD | |
sudo iptables -L --line-numbers | |
#delete a rule with a number; syntax: iptables -D <OUTPUT|INPUT|FORWARD> <line_number> | |
sudo iptables -D OUTPUT 3 | |
#delete all rules in a chain ;chain= INPUT, OUTPUT or FORWARD | |
sudo iptables -F INPUT | |
# |
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
#show language | |
locale | |
#change keyboard quickly | |
loadkeys de | |
#for X | |
setxkbmap de | |
#system wide, if ubuntu | |
sudo dpkg-reconfigure console-setup | |
#toggle us de | |
setxkbmap -option grp:alt_shift_toggle us,de |
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-EnabledRules | |
{ | |
Param($profile) | |
$rules = (New-Object -comObject HNetCfg.FwPolicy2).rules | |
$rules = $rules | where-object {$_.Enabled -eq $true} | |
$rules = $rules | where-object {$_.Profiles -bAND $profile} | |
$rules | |
} | |
$networkListManager = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}")) |
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
Difference between Home,Work,Public is about SHARING policy. | |
Public to be used when using a public Internet connection, for example | |
"Public" Network Profile: -more secure | |
- turn off sharing and not allow others to see your computer | |
"Home" Network- win7 network.Mixed XP,Linux or Max could be dangerous | |
-like an open network, joined by a SINGLE password and supports media sharing | |
"Work" Network- is XP style file sharing- with username and pass to connect to other comps | |
-is safe because is controlled by user account and share permissions, for example | |
in mixed OSs cases. |
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 apt-get update | |
sudo apt-get install samba | |
#we need a different username and password for sambaserver | |
#for convenience, the user and passsword could be same as the username we are logged in linux | |
sudo smbpasswd -a <user_name> | |
#optional if the user is not the owner of the folder | |
#if apache and the user has is not owner(usually root) we need to chmod with and chown | |
#sudo chmod 2775 /var/www -R | |
#sudo chown root:<user_name> /var/www | |
sudo chown <user_name> /var/opt/folder |
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
# ------------------ NETSH --------------- | |
# | |
#for help: $ netsh /? | |
#NETSTAT | |
# | |
#usefull | |
netstat -bn |
NewerOlder