Skip to content

Instantly share code, notes, and snippets.

@ismarsantos
ismarsantos / README.md
Created August 14, 2023 01:11 — forked from hardiksondagar/README.md
Ubuntu: Bash history search, partial + up-arrow

Both methods below are almost equivalent, it just depends on which file you want to edit. I'd recommend .bashrc myself, as it doesn't involve editing a local copy of a system file.

If you experience any problems with this, please comment below so that it can be fixed.

Using ~/.bashrc

  1. Edit ~/.bashrc with this command:
gedit ~/.bashrc
@ismarsantos
ismarsantos / maps.txt
Created August 8, 2023 18:16 — forked from AmandaCarvalho-R/maps.txt
Google maps configuration
step 1
sudo nano /etc/hosts
add line
127.0.1.1 lvh.me
https://console.cloud.google.com/apis/credentials
Set an application restriction
Application restrictions limit an API key’s usage to specific websites, IP addresses, Android applications, or iOS applications. You can set one application restriction per key.
@ismarsantos
ismarsantos / gist:cea11b371123818b195ed35561d9333d
Created July 12, 2023 19:29
Getting "fatal: Authentication failed" -error when sending git commands in Windows 10
The password is stored in windows credential manager and needs to be updated. Open command prompt and enter the following command to view the list of stored passwords:
rundll32.exe keymgr.dll,KRShowKeyMgr
Scroll down in the list until you spot the git-related entries. Click it and edit the correct password.
Voilà
https://stackoverflow.com/a/42830319
@ismarsantos
ismarsantos / win11.xml
Created June 20, 2023 22:19 — forked from akitaonrails/win11.xml
My Windows 11 libvirt XML configuration
<domain type='kvm'>
<name>win11-real</name>
<uuid>45768371-b871-4937-b7c2-60ed835011de</uuid>
<metadata>
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
<libosinfo:os id="http://microsoft.com/win/10"/>
</libosinfo:libosinfo>
</metadata>
<memory unit='KiB'>33554432</memory>
<currentMemory unit='KiB'>33554432</currentMemory>
@ismarsantos
ismarsantos / gist:5c98d1100eb05987fa47943c81594507
Created June 7, 2023 15:30
Access WSL webserver in local network
See this video, it helped me:
https://www.youtube.com/watch?v=yCK3easuYm4
netsh interface portproxy add v4tov4 listenport=<port-to-listen> listenaddress=0.0.0.0 connectport=<port-to-forward> connectaddress=<forward-to-this-IP-address>
for example
netsh interface portproxy add v4tov4 listenport=3000 listenaddress=0.0.0.0 connectport=3000 connectaddress=127.0.0.1
Microsoft has published a little bit of information about this on their WSL1 to WSL2 comparison page
@ismarsantos
ismarsantos / using-uuid-as-pk.md
Created February 6, 2023 19:19 — forked from rponte/using-uuid-as-pk.md
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes

@ismarsantos
ismarsantos / wsl_user.md
Created January 31, 2023 17:13
How to set default user for manually installed WSL distro "wsl --import"

Side Note: This question was specifically about setting the default username in an imported instance. However, for completeness, you can also set the default username for a distro that was installed from the Store (or wsl --install) with:

<distro>.exe config --default-user <username>

For instance, if you installed "Ubuntu 20.04" from the Store, you would use:

ubuntu2004.exe config --default-user <username>

The .exe here is an "App Execution Alias" in Windows. You can check the name by going to "Manage app execution aliases" in the Windows System Settings.

<div class="row" data-controller="units">
<div class="col">
<%= render "shared/forms/label", locals: { form: form, input: :unit, presence: true } %>
<div class="row">
<div class="col">
<div class="input-group">
<%= form.select :unit_ids, build_options, { include_blank: false },
{
id: 'units',

This is a work in progress, proceed with caution

Install Proxmox and a Ubuntu VM with Portainer to manage docker containers

Setup Proxmox

  1. Install Proxmox 6.X iso I selected 2 drives in Raid 1 mirror
  2. Console/SSH into Proxmox
  3. nano /etc/apt/sources.list
# cat /home/dokku/cloud/nginx.conf
server {
listen [::]:80;
listen 80;
server_name cloud.domain.com;
access_log /var/log/nginx/cloud-access.log;
error_log /var/log/nginx/cloud-error.log;
include /home/dokku/cloud/nginx.conf.d/*.conf;