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
| /var/log/pacman.log | |
| sudo pacman -Syu --noconfirm #Update and upgrade all packages on the system | |
| pacman -Sc #Clean package cache | |
| sudo pacman -Syy #Update package list | |
| pacman -Qe #List explictly-installed packages | |
| pacman -Qdt #List unneeded packages | |
| pacman -Rns $(pacman -Qdtq) #Uninstall unneeded packages |
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
| #check if pytorch is using the GPU | |
| python -c 'import torch; print(torch.cuda.is_available())' #should print True | |
| python -c 'import torch; print(torch.rand(2,3).cuda())' | |
| watch -n 2 nvidia-smi | |
| ========================================================================= | |
| import torch | |
| dev = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu") |
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
| ============================================================================================= | |
| openBSD | |
| add repo url | |
| echo 'https://cdn.openbsd.org/pub/OpenBSD' > /etc/installurl | |
| $ doas pkg_add -xz python-2.7 ansible py-psycopg2 | |
| $ ansible --version | |
| ansible 2.8.5 | |
| $ doas pkg_add git |
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
| ============================================================================================= | |
| Additional Checks for Windows 11: | |
| Virtualization Enabled: Ensure VT-x/AMD-V is enabled in BIOS/UEFI. | |
| Enable GUI temporarily for visual debugging: | |
| In the Vagrantfile, change vb.gui = false to vb.gui = true to see what's happening during boot |
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
| ------------------------------------------------------------------------------------------ | |
| curl -I -sS http://localhost:7777 | sed -n '1,6p' | |
| curl → makes a request to the given URL. | |
| -I → fetches only the HTTP headers (HEAD request instead of GET). | |
| -sS → silent mode (hides progress bar), but still shows errors if they occur. | |
| http://localhost:7777 → target URL (your web server running on port 7777). |
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
| -------------------------------------------------------------------------------------------------------------------------- | |
| $ git clone https://kevzettler@bitbucket.org/kevzettler/git-blame-example.git && cd git-blame-example | |
| $ git log | |
| $ git blame README.md | |
| $ git blame -L 1,5 README.md | |
| $ git blame -e README.md | |
| # list all original commits in-which a specific code piece was added or modified execute | |
| $ git log -S"This repository is an example of a project" --pretty=format:'%h %an %ad %s' |
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
| ----------------------------------------------------------------------------------------------------- | |
| #Debian | |
| sudo apt-get install puppet -y | |
| #RedHat | |
| rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm | |
| yes | sudo yum install puppet | |
| ls -l /etc/puppet | |
| facter | grep hostname | |
| ----------------------------------------------------------------------------------------------------- |
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
| # mysql | |
| $ sudo mysql -u root -p | |
| mysql>create database spacedb; | |
| mysql>create user 'cosmo'@'localhost' identified by 'password'; | |
| mysql>GRANT ALL PRIVILEGES ON spacedb.* TO 'cosmo'@'localhost'; | |
| $ mysql -u cosmo -p | |
| mysql> use spacedb; | |
| CREATE TABLE IF NOT EXISTS city( | |
| id int(11) NULL, |
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 grep -v '^#' simplelist.txt | awk -F, '{printf("%s:\n device_type:%s\n ip: %s\n username:netadmin\n password:secretpass\n port:22\n",$1,$2,$1)}' | sudo tee netmiko.yml |
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
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| https://www.wireshark.org/docs/dfref/ #Display Filter Reference | |
| -----------------------------------------------------------1-----------------------------------------------1------------------------------------------------------------------------- | |
| #Bing | |
| Step-by-step instructions to decrypt TLS traffic from Chrome or Firefox in Wireshark: | |
| https://wiki.wireshark.org/TLS. | |
| How to decrypt TLS traffic in Wireshark | |
| https://www.packetsafari.com/blog/2022/10/07/wireshark-decryption/ |