Skip to content

Instantly share code, notes, and snippets.

View duclos-cavalcanti's full-sized avatar
💭
Hi!

Daniel Duclos-Cavalcanti duclos-cavalcanti

💭
Hi!
View GitHub Profile
@duclos-cavalcanti
duclos-cavalcanti / Wifi-CLI.md
Created August 17, 2023 18:23
Connecting to wifi through the command line
  1. Use ip link to find the name of your wifi interface. Common names include wlan0, wlp2s0, wlx00e04c361e2, etc.
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
3: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
@duclos-cavalcanti
duclos-cavalcanti / Parted.md
Last active August 10, 2023 19:43
Using Parted CLI to partition your system

If needed, set the keyboard layout with setxkbmap us beforehand. Adjust the country to your device's configuration.

  1. Use lsblk to know what's the disk path to be partitioned.
  2. Launch parted on said disk path:
# Launches parted
sudo parted /dev/sda
  1. Partition:
@duclos-cavalcanti
duclos-cavalcanti / README.md
Last active April 3, 2023 01:07
SSH cheat sheet

SSH cheat sheet

0. Basics

0.1 Commands

  • Check the IP address
sudo ifconfig
  • Connect
ssh -p  @
@duclos-cavalcanti
duclos-cavalcanti / ffmpeg.md
Created October 14, 2022 09:12 — forked from steven2358/ffmpeg.md
FFmpeg cheat sheet
@duclos-cavalcanti
duclos-cavalcanti / $README.md
Last active April 4, 2023 00:15
a base neomutt rc and it's corresponding files within a small idiomatic repo

Basic Neomutt Configuration

NeoMutt is an amazing TUI-based email client that can run from within your terminal. It's lightweight, configurable and easily extendable. This example is shown and configured for a basic Gmail account that requires 2-step authentication and can send encrypted messages with GnuPG.

1. Dependencies

The software listed and how it is installed is exemplified for an arch-based linux system.

@duclos-cavalcanti
duclos-cavalcanti / linked_list.c
Last active October 7, 2022 04:32
Simple, generic and opaque data linked list in C
#include "linked_list.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
list_t* new_list() {
list_t* ret = (list_t*) calloc(1, sizeof(list_t));
if (!ret) {
@duclos-cavalcanti
duclos-cavalcanti / run_grep.py
Created September 12, 2022 11:00
Search through the output of a command for a specific regex pattern in Python
import subprocess
import os
import re
def search(string:str, pattern:str) -> bool:
x = re.search(pattern, string)
if x:
return True
return False
@duclos-cavalcanti
duclos-cavalcanti / ANSI.md
Created February 23, 2022 02:39 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27