Skip to content

Instantly share code, notes, and snippets.

@githubfoam
githubfoam / python script cheat sheet
Last active March 23, 2026 03:33
python script cheat sheet
------------------------------------------------------------------------------------------
python3 -V
python2 -V
------------------------------------------------------------------------------------------
#Command-line one-liners
# -c run Python script sent in as cmd string
python -c "print(3.0/2)"
python -c "import math;print(math.sin(1))"
python -c "for i in range(1,5):print(i)"
@githubfoam
githubfoam / ruby scripting cheat sheet
Last active April 11, 2022 08:28
ruby scripting cheat sheet
------------------------------------------------------------------------------------------
$ cat app.rb
puts "Type your name :"
name = gets.chomp
puts "Hello world " + name
$ ruby app.rb
Type your name :
------------------------------------------------------------------------------------------
@githubfoam
githubfoam / go scripting cheat sheet
Created March 25, 2022 06:40
go scripting cheat sheet
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
#hello_world.go
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
@githubfoam
githubfoam / awk cheat sheet
Last active December 14, 2022 07:29
awk cheat sheet
----------------------------------------------------------------------------------------------------
NF is a predefined variable whose value is the number of fields in the current record
parse fields by field separator FS (default single space)
----------------------------------------------------------------------------------------------------
#string match,tab delimited file, starting with any of letter A,C,T,G ending with forward slash
$ cat test.txt
id1 342 C/T
id2 7453 T/A/-/G/C
id3 531 T/C
@githubfoam
githubfoam / windows forensics cheat sheet
Last active May 7, 2026 08:51
windows forensics cheat sheet
============================================================================
https://www.sans.org/tools/
============================================================================
FTK Imager, ANJP, EZ Tools, SIFT, Regripper, Windows Event Log Explorer, Volatility, Plaso, DensityScout, SigCheck
============================================================================
Live System Analysis for computers with Windows 10 operating system with tools such as Sysinternals, Powershell, WM
Collecting triage data and parsing methods with KAPE
Physical Imaging with FTK Imager
Logical Imaging with FTK Imager
Memory Imaging with FTK Imager, DumpIT, WinPmem
@githubfoam
githubfoam / ssh lab
Last active December 22, 2023 10:57
sshblab
--------------------------------------------------------------------------------------------------------------------------
#To create a user on an Ubuntu server and set up passwordless SSH access using a private key from a Windows 10 desktop, follow these steps:
Ubuntu 22.04.3 LTS
Windows 11 Desktop
On Windows 11 Desktop:
Generate SSH Key Pair (if not already generated):
@githubfoam
githubfoam / microsoft visual studio code cheat sheet
Last active August 8, 2025 11:59
microsoft visual studio code cheat sheet
------------------------------------------------------------------------------------------
Step-by-Step Guide: Creating a GitHub Repository and Uploading Files from VS Code
This guide will walk you through the process of creating a new GitHub repository and then using Visual Studio Code (VS Code) on Windows 10 to upload your workflow and PowerShell script.
Part 1: Create a New GitHub Repository
First, you need to create a place for your files on the GitHub website.
Go to GitHub: Open a web browser and go to https://github.com/.
@githubfoam
githubfoam / chocolatey cheat sheet
Last active September 27, 2026 00:52
chocolatey cheat sheet
==========================================================================================================
# powershell (black)
#Install chocolatey windows 11
Set-ExecutionPolicy Bypass -Scope Process -Force
 
[System.Net.ServicePointManager]::SecurityProtocol = `
[System.Net.ServicePointManager]::SecurityProtocol -bor 3072
 
@githubfoam
githubfoam / python windows experience
Last active August 27, 2025 06:04
python windows experience
============================================================================
>where python (cmd)
============================================================================
#add interpreter
File-Settings-Project:PycharmProjects-Python Interpreter
============================================================================
py --help
modules
python -help
@githubfoam
githubfoam / huawei switch cheat sheet
Last active October 16, 2026 16:56
huawei switch cheat sheet
------------------------------------------------------------------------------------------------------------------------------
>display snmp-agent ?
community Display the SNMPv1 or SNMPv2c community name
extend SNMP extend configuration
group Display the information of groups based on USM
heartbeat Heartbeat
inform Display config parameters of the inform alarm
local-engineid Display the engine ID of local SNMP entity
mib-view Display the SNMP MIB view
notification-log Notification log