Skip to content

Instantly share code, notes, and snippets.

View adrianokerber's full-sized avatar
🏠
Homeoffice

Adriano Kerber adrianokerber

🏠
Homeoffice
View GitHub Profile
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution
Last active July 3, 2024 20:33
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
@felipeplets
felipeplets / README.md
Last active November 16, 2022 15:28
Better setup for iTerm

iTerm2

Plist

The Plist file above is located at ~/Library/Preferences/com.googlecode.iterm2.plist but the file is binary and not XML. To edit and replace the XML I recommend using Visual Studio Code with the extension Binary Plist. VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=dnicolson.binary-plist

The steps bellow are not needed if the settings file is replaced.

@rdeavila
rdeavila / git-update-fork.sh
Last active June 28, 2024 13:53
Git: como atualizar um fork com as mudanças do original?
#!/bin/bash
# Adicione um novo remote; pode chamá-lo de "upstream":
git remote add upstream https://github.com/usuario/projeto.git
# Obtenha todos os branches deste novo remote,
# como o upstream/master por exemplo:
git fetch upstream
@digitaljhelms
digitaljhelms / gist:4287848
Last active July 5, 2024 16:30
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@anderson-martins
anderson-martins / listaDiretorio.java
Created August 16, 2012 17:28
Lista arquivos, pastas e subpastas de um diretorio
public static java.util.List<FileItem> listDirectoryAppend(File dir, java.util.List<FileItem> lista) {
if (dir.isDirectory()) {
String[] filhos = dir.list();
for (int i = 0; i < filhos.length; i++) {
File nome = new File(dir, filhos[i]);
if (nome.isFile()) {
if (nome.getName().toUpperCase().endsWith(".GBK")) {
lista.add(new FileItem(nome));
}
} else if (nome.isDirectory()) {