Trang chủ‎ > ‎IT‎ > ‎

Ubuntu

- Copy folder:  
    sudo cp -R <SrcFolder>/* <DestFolder>
- Search files for contains text:
        grep -r "<Content to search>" <FolderToSearch>
- Locate file:
        locate <file or folder>
- package config
        pkg-config --cflags --libs <library name or path>
        ex: pkg-config --cflags --libs gstreamer-0.10

#block outgoing tcp on port 443 to destination ip address
sudo iptables -A OUTPUT -p tcp --dport 443 -d 54.218.xxx.233 -j DROP
sudo iptables -A OUTPUT -p tcp --dport 443 -d 54.245.xxx.9 -j DROP
sudo iptables -A OUTPUT -p tcp --dport 443 -d 50.112.xxx.6 -j DROP
sudo iptables -A OUTPUT -p tcp --dport 443 -d 54.71.xxx.178 -j DROP

#view rules set
sudo iptables -L

#save rules to file
sudo sh -c "iptables-save > /etc/iptables.rules"

#add restore rule to network interfaces when restarted
sudo nano /etc/network/interfaces
#add below to file
pre-up iptables-restore < /etc/iptables.rules