Skip to content

Instantly share code, notes, and snippets.

View accdias's full-sized avatar

Antonio Dias accdias

View GitHub Profile
@jdoss
jdoss / LUKS_and_TPM2_with_Fedora.md
Last active July 20, 2024 00:04
Decrypt LUKS volumes with a TPM on Fedora Linux

Decrypt LUKS volumes with a TPM on Fedora Linux

This guide allows you to use the TPM on your computer to decrypt your LUKS encrypted volumes. If you are worried about a cold boot attack on your hardware please DO NOT use this guide with your root volume!

Preflight Checks

Verify that you have a TPM in your computer:

# systemd-cryptenroll --tpm2-device=list
PATH DEVICE DRIVER
@opalczynski
opalczynski / main.py
Created October 5, 2021 14:32
Final version of main.py for CLI
import typer
from database import Database
from data import Project, Task
from constants import TaskStatusE
app = typer.Typer()
project_app = typer.Typer()
task_app = typer.Typer()
project_app.add_typer(task_app, name="tasks")
@donly
donly / sh.sh
Last active February 14, 2023 20:38 — forked from scottopell/sh.sh
Embed SRT file into mp4 with ffmpeg
# got this from http://stackoverflow.com/questions/8672809/use-ffmpeg-to-add-text-subtitles
ffmpeg -i infile.mp4 -f srt -i infile.srt -c:v copy -c:a copy -c:s mov_text -metadata:s:s:0 language=chi outfile.mp4
# confirmed working with the following ffmpeg
# (installed using `brew 'ffmpeg', args: ['with-libvorbis', 'with-libvpx']` )
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with Apple clang version 12.0.0 (clang-1200.0.32.2)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libx
@stephonchen
stephonchen / Deploy_Oracle_Linux_in_GCE.md
Last active July 15, 2024 10:50
Deploy Oracle Linux in GCE
  • Install Oracle Linux in VirtualBox

  • Before shutdown, be aware to do these things

    • Edit /etc/default/grub
      • Remove splash & quiet & rhgb
      • Add console=ttyS0,38400n8d
    • Update grub
      sudo grub2-mkconfig -o /boot/grub2/grub.cfg
      
@yougg
yougg / proxy.md
Last active July 17, 2024 09:23
complete ways to set http/socks/ssh proxy environment variables

set http or socks proxy environment variables

# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT

# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT

# set http proxy with user and password (with special characters)
@mcattarinussi
mcattarinussi / gpg-ssh-setup.md
Last active July 19, 2024 07:06
A setup guide to use a personal gpg key for ssh authentication

GPG - SSH setup

Generating the master key

Here we create the master key. We want only Certify capability: we use the master key only to create the subkeys, Sign - Encrypt - Authenticate capabilities will be assigned to the subkeys.

Run the following command to start the master key generation process. Select the set your own capabilities creation process (type 8)

  ▶ gpg --full-generate-key --expert

gpg (GnuPG) 2.2.9; Copyright (C) 2018 Free Software Foundation, Inc.

@thomdixon
thomdixon / ssh_certificate.py
Last active October 14, 2021 10:25
Simple implementation of SSH certificates for Python using Paramiko. Supports serializing from and to Message objects.
from collections import OrderedDict
import paramiko
from paramiko.agent import AgentKey
from paramiko.message import Message
CERT_ATTRIBUTE_TO_TYPE = {
'name': 'string',
'nonce': 'string',
[Unit]
Description=WS02 Identity Server
[Service]
Type=simple
PIDFile=/opt/WSO2/wso2is-5.4.0/wso2carbon.pid
Environment=JAVA_HOME=/usr/java/jdk1.8.0_161
Environment=CARBON_HOME=/opt/WSO2/wso2is-5.4.0
User=wso2
PermissionsStartOnly=true
@Pulimet
Pulimet / AdbCommands
Last active July 20, 2024 12:55
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@tuxfight3r
tuxfight3r / sfdisk.sh
Created March 6, 2017 16:01
use sfdisk to create scripted partitions
##create one big partition
echo ';' | sfdisk /dev/sdc
##create one big partition with specific partition type
#creates W95 FAT32 (LBA)
echo ',,c;' | sfdisk /dev/sdd
#creates lvm type
echo ',,8e;' | sfdisk /dev/sdd