Skip to content

Instantly share code, notes, and snippets.

@githubfoam
githubfoam / CMake experience
Last active July 15, 2021 10:23
CMake experience
# Ubuntu 16.04.5 LTS
sudo apt-get update && sudo apt-get install build-essential
sudo apt-get install cmake
cmake -version
cat<<EOF>helloworld.cpp
#include<iostream>
int main(int argc, char *argv[]){
std::cout << "Hola CMake" << std::endl;
@githubfoam
githubfoam / mysql cheat sheet
Last active March 23, 2026 03:33
mysql cheat sheet
Operating System: Ubuntu 16.04.5 LTS
Kernel: Linux 4.4.0-116-generic
Architecture: x86-64
dpkg -l | grep mysql | grep ii
sudo service mysql status
sudo service mysql stop
sudo service mysql start
mysql -u root -p
@githubfoam
githubfoam / iperf cheatsheet
Last active December 2, 2021 12:48
iperf cheatsheet
===================================================server======================================================
$ hostnamectl
Static hostname: control-machine
Icon name: computer-vm
Chassis: vm
Machine ID: 4f8ea72f17144f5a86367a4aeeb5c3e4
Boot ID: b846f130028d48cb960e5498b75d11ef
Virtualization: oracle
Operating System: Ubuntu 18.04.1 LTS
Kernel: Linux 4.15.0-29-generic
@githubfoam
githubfoam / Performance Analysis & Profiling
Last active May 30, 2019 23:39
Performance Analysis & Profiling
# Ubuntu 18.04
sudo apt install linux-tools-$(uname -r) linux-tools-generic -y
$ perf --version
perf version 4.18.12
# stat: runs a command and gathers performance counter statistics from it, command -> tree -a
sudo perf stat tree -a
# top: generates and displays a performance counter profile in real time
sudo perf top
@githubfoam
githubfoam / HPC cheatsheet
Last active July 28, 2019 14:19
HPC cheatsheet
$ pdsh -l vagrant -w ssh:compute02 ls -lai
$ pdsh -l vagrant -w ssh:compute01 uptime
$ wwsh file print network
$ wwsh provision print
$ wwsh node print compute01
$ wwsh vnfs list
$ pbsnodes -a
@githubfoam
githubfoam / cryptography
Last active September 1, 2023 11:58
cryptography
--------------------------------------------------------------------------------------------------
$ openssl version
$ openssl version -a
--------------------------------------------------------------------------------------------------
#find out which versions of TLS are configured on a web server
Firefox - click the padlock icon (on the left of the URL) - More Information - Technical Details
Chrome - More Tools - Developer Tools - Security
Edge - More Tools - Developer Tools - Security
https://www.ssllabs.com/ssltest/ #public websites
@githubfoam
githubfoam / docker-compose cheat sheet
Last active June 7, 2026 16:41
docker-compose cheat sheet
#=====================================================================
services: # Define the services (containers) in this Compose file
nagios: # Service name: nagios
image: nagios459-debian12:latest # Use the pre-built Nagios Debian 12 image
container_name: nagios # Assign a custom container name for easier reference
restart: unless-stopped # Restart policy: restart container unless explicitly stopped
environment: # Define environment variables for the container
NAGIOS_FQDN: nagios.example.com # Fully Qualified Domain Name for Nagios
NAGIOSADMIN_USER: nagiosadmin # Admin username for Nagios web interface
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
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/
@githubfoam
githubfoam / network automation
Created October 4, 2019 17:27
network automation
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
@githubfoam
githubfoam / sql cheat sheet
Created December 18, 2019 21:45
sql cheat sheet
# 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,