Skip to content

Instantly share code, notes, and snippets.

View AlexString's full-sized avatar
Coffee love

Alex String AlexString

Coffee love
View GitHub Profile
@AlexString
AlexString / AutomaticMountingDisks_Linux.md
Last active December 8, 2021 06:34
Setting a HDD or SDD to mount automatically on Linux

How to set a disk to automatic mount

Steps

  • First you need to know what is the UUID of the disk you're going to mount sudo blkid

  • You'll need to make the directory that is gonna be for mounting:

@AlexString
AlexString / InstallPipewireFedora.md
Created December 7, 2021 19:30
Install Pipewire on Fedora

Install Pipewire on Fedora

pactl info to show which audio server is running. In occasions this tends to fail showing Connection failure: connection refused. I think this is saying that there is no connection to an audio server so you'll need to enable manually the service using systemctl. please comment about it if you know more of this.

Install pipewire

If you try installing pipewire without removing pulseaudio you'll get a conflict message complaining about it.

@AlexString
AlexString / askYesNo.sh
Last active November 28, 2021 19:20
"Yes or no" function in shell script with default values.
#!bin/bash
# Author: NaN
# source: https://stackoverflow.com/questions/29436275/how-to-prompt-for-yes-or-no-in-bash
# function
function askYesNo {
QUESTION=$1
DEFAULT=$2
if [ "$DEFAULT" = true ]; then
@AlexString
AlexString / change_var_names.md
Created November 20, 2021 21:08
Quickly change variable names in nvim

Change variable names with vim keys

This also works on VS Code vim plugin:

For small amounts of var copies.

* cw NEWNAME <esc> then repeat n. for other ocurrences

But better

@AlexString
AlexString / colored.py
Created November 20, 2021 19:37
Print colored text in python
def colored(r, g, b, text):
return "\033[38;2;{};{};{}m{} \033[38;2;255;255;255m".format(r, g, b, text)
# example
if __name__ == "__main__":
"""
text = 'Hello, World!'
colored_text = colored(255, 0, 0, text)
print(colored_text)
@AlexString
AlexString / pycrypto_python2.md
Last active November 3, 2021 21:37
Solution to: Crypto.Hash module import error
@AlexString
AlexString / History\-104936cf\entries.json
Last active May 14, 2022 19:03
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///d%3A/Projects/javascript/exadmision_react/src/types/index.ts","entries":[{"id":"CEmJ.ts","source":"Workspace Edit","timestamp":1652117658771},{"id":"RrSs.ts","timestamp":1652117983222},{"id":"Z9MC.ts","source":"Workspace Edit","timestamp":1652126909654},{"id":"Btnt.ts","timestamp":1652126916529},{"id":"Q3Y4.ts","timestamp":1652126985769},{"id":"eDT2.ts","timestamp":1652127029813},{"id":"u1VW.ts","timestamp":1652127268009}]}