Skip to content

Instantly share code, notes, and snippets.

View danielscarvalho's full-sized avatar
:octocat:
Coding!

Daniel de Souza Carvalho danielscarvalho

:octocat:
Coding!
View GitHub Profile
@danielscarvalho
danielscarvalho / gitHttps2Ssh.md
Last active May 21, 2024 14:50
Switching remote URLs from HTTPS to SSH

Switching remote URLs from HTTPS to SSH

Open Terminal
Change the current working directory to your local project
Change your remote's URL from HTTPS to SSH with the git remote set-url command

git remote set-url origin git@github.com:OWNER/REPOSITORY.git
@danielscarvalho
danielscarvalho / installgo.sh
Last active April 17, 2024 01:24
Install go Linux
sudo tar -C /opt -xzf go1.22.2.linux-amd64.tar.gz
# https://go.dev/doc/install
@danielscarvalho
danielscarvalho / pdf2txt.sh
Last active March 19, 2024 22:11
PDF to TXT Linux terminal
sudo apt install poppler-utils
pdftotext -layout input.pdf output.txt
@danielscarvalho
danielscarvalho / random_datetime.py
Last active March 13, 2024 17:59
Random Date Time
import numpy as np
def getrandomdatetime():
return str(datetime.fromtimestamp(np.random.randint(0, 2177334732)))
@danielscarvalho
danielscarvalho / upload-project-github.sh
Created February 24, 2024 02:36
Upload the current project folder to a new repo at GitHub
echo "# Project-Name" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:danielscarvalho/<New Project Name>.git
git push -u origin main
@danielscarvalho
danielscarvalho / createbigfile.sh
Last active March 13, 2024 18:00
Create big random text file
#Create big random text file
base64 /dev/urandom | head -c 1GB > rand-text-1gb-`uuidgen | tr -d '-'`.txt
@danielscarvalho
danielscarvalho / linuxstartup.sh
Created January 29, 2024 22:42
Linux startup analisys
systemd-analyze
systemd-analyze blame
systemd-analyze critical-chain
# https://askubuntu.com/questions/1457368/help-me-troubleshoot-my-slow-boot-time-more-than-2-min
@danielscarvalho
danielscarvalho / gitsetrepourl.sh
Created January 29, 2024 22:38
Git: Change your remote's URL from SSH to HTTPS with the git remote set-url command
# Change your remote's URL from SSH to HTTPS with the git remote set-url command.
# https://docs.github.com/en/get-started/getting-started-with-git/managing-remote-repositories
git remote set-url origin https://github.com/OWNER/REPOSITORY.git
cd "C:\Program Files\Oracle\VirtualBox\"
VBoxManage.exe modifyvm "Your Virtual Machine Name" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "Your Virtual Machine Name" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "Your Virtual Machine Name" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "Your Virtual Machine Name" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "Your Virtual Machine Name" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "Your Virtual Machine Name" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
@danielscarvalho
danielscarvalho / linux_live_test.sh
Created October 24, 2023 04:58
Test live Linux on pedrive
lsusb
sudo qemu-system-x86_64 -m 512 -enable-kvm -usb -device usb-host,hostbus=1,hostaddr=4