Skip to content

Instantly share code, notes, and snippets.

@NanoDano
NanoDano / clojure_basics.md
Created June 3, 2020 20:33
Clojure install and hello world basics
@NanoDano
NanoDano / crystal_lang_basics.md
Created June 3, 2020 20:37
Crystal language basics
@NanoDano
NanoDano / dart_lang_basis.md
Created June 3, 2020 20:41
Dart language basics
@NanoDano
NanoDano / mongodb_queries_commands.md
Created June 3, 2020 20:42
MongoDB example commands and queries from WebGenome project

Sample MongoDB commands

show dbs
use <db>  # also creates
show collections
db.getCollectionNames()
db.showCollections()
db.domains.getIndexes()
db.domains.stats()
@NanoDano
NanoDano / nasm_examples.md
Created June 3, 2020 20:48
Nasm NetAssembler Assembly examples

nasm Net Assembler Assembly

Compile and link

Compile with:

nasm -f elf64 file.asm
# or -f elf for 32 bit
@NanoDano
NanoDano / powershell_http_example.md
Created June 3, 2020 20:51
Powershell make HTTP GET request
@NanoDano
NanoDano / check_if_root.sh
Created June 3, 2020 20:59
Bash check if user is root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root. Exiting"
exit 1
fi
@NanoDano
NanoDano / bash_shell_terminal_colors.md
Created June 3, 2020 21:00
Bash shell terminal colors

Colors

Black       0;30     Dark Gray     1;30
Blue        0;34     Light Blue    1;34
Green       0;32     Light Green   1;32
Cyan        0;36     Light Cyan    1;36
Red         0;31     Light Red     1;31
Purple      0;35     Light Purple  1;35
Brown 0;33 Yellow 1;33
@NanoDano
NanoDano / bash_if_examples.sh
Created June 3, 2020 21:01
Bash IF statement examples
# Specific number of iterations
for i in $(seq 1 10)
do
echo $i
done
# Specify list
for x in test.txt misc.txt other.txt
do
rm $x
@NanoDano
NanoDano / bash_function_arg_examples.sh
Created June 3, 2020 21:01
Bash functions with arguments examples
# Define a function
hello() {
echo "Hello, world!"
}
# Run the function
hello
# Using function arguments
hello() {