Skip to content

Instantly share code, notes, and snippets.

View rmoyano's full-sized avatar

Rafael Moyano rmoyano

View GitHub Profile
@rmoyano
rmoyano / pipenv.md
Last active June 14, 2024 05:09
Pipenv cheatsheet

Pipenv cheatsheet

Installation

Install pipenv package and dependencies:

user@notebook:~/repos/pipenv$ pip install pipenv
Defaulting to user installation because normal site-packages is not writeable
Collecting pipenv
  Downloading pipenv-2023.12.1-py3-none-any.whl (3.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.1/3.1 MB 9.8 MB/s eta 0:00:00
@rmoyano
rmoyano / curl.md
Last active June 14, 2025 11:42
Curl cheatsheet

CURL cheatsheet

GET query

rmoyano@thinkpad:~/code/horarios$ curl http://127.0.0.1:8000/
{"Hello":"World"}

Get the header response

Nmap cheatsheet

Tests

Basic test using Google IP:

user@notebook:~$ nmap 8.8.8.8
Starting Nmap 7.80 ( https://nmap.org ) at 2024-06-03 13:52 -03
Nmap scan report for dns.google (8.8.8.8)
Host is up (0.027s latency).
Not shown: 998 filtered ports
@rmoyano
rmoyano / docker.md
Created June 14, 2024 05:23
Docker notes

Docker notes

Entrypoint and CMD differences

One SO thread.

From Devopscube article:

In a Dockerfile, ENTRYPOINT and CMD are two different instructions that are used to define how a container should run.

ENTRYPOINT is used to specify the main command that should be executed when a container is started using the image. The default ENTRYPOINT command is /bin/sh -c.

@rmoyano
rmoyano / apt.md
Last active June 9, 2025 13:26
APT

Installation

Assume yes to all prompts:

$ apt-get install ca-certificates curl -y

apt-get -y install One side effect of using -y is that it will skip downgrades, whereas if the user entered y, it would perform the downgrades. So if you want -y to execute the same thing as a user entering y,you also need to add --allow-downgrades

@rmoyano
rmoyano / flossbooks.md
Last active June 25, 2025 20:29
Best GNU/Linux open free books

Best GNU/Linux open free books

General books

The Linux Command Line: One of the best Linux books I have ever read. Written by William Shotts.

Distros

Debian

The Debian Administrator's Handbook: This book teaches the essentials to anyone who wants to become an effective and independent Debian GNU/Linux administrator. Written by Raphaël Hertzog and Roland Mas.

@rmoyano
rmoyano / shellscripting.md
Created February 24, 2025 16:58
Shell scripting

Difference between "#!/usr/bin/env bash" and "#!/usr/bin/bash": Official Slackware book created by David Cantrell, Logan Johnson & Chris Lumens. Version 2.0 is a draft that is in development.

Because /usr/bin/env can interpret your $PATH, which makes scripts more portable.
#!/usr/bin/env bash #lends you some flexibility on different systems
Running a command through /usr/bin/env has the benefit of looking for whatever the default version of the program is in your current environment.

Will only run your script if python is installed in /usr/local/bin.