Skip to content

Instantly share code, notes, and snippets.

@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution
Last active November 1, 2024 16:58
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.

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@sam33rdhakal
sam33rdhakal / HowdysRealmSerializerGenerator.java
Last active December 17, 2021 16:22
Script for generating RealmObject Serializer. Uses JavaPoet to write file.
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import com.squareup.javapoet.*;
import javax.lang.model.element.Modifier;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Field;
anonymous
anonymous / continuous_deploy.sh
Created May 16, 2013 21:12
A short script to perform auto install on multiple Android devices by watching a specific folder for an .apk write. Usage: ./continuous_deploy.sh com.example.package/.MainActivity
folder="bin/classes/"
package="$1"
inotifywait -m -q -e close_write "$folder" | while read f; do
# take only the filename
f=`awk '{print $3}' <<< "$f"`
# rebuild the full path
path="$folder$f"
@nzakas
nzakas / gist:5511916
Created May 3, 2013 17:47
Using GitHub inside a company

I'm doing some research on how companies use GitHub Enterprise (or public GitHub) internally. If you can help out by answering a few questions, I'd greatly appreciate it.

  1. What is the primary setup? Is there an organization and each official repo is owned by that organization?
  2. Does every engineer have a fork of each repo they're working on?
  3. Are engineers allowed to push directly to the official repo? Or must all commits go through a pull request?
  4. Do engineers work on feature branches on the main repo or on their own forks?
  5. Do you require engineers to squash commits and rebase before merging?
  6. Overall, what is the workflow for getting a new commit into the main repository?
  7. What sort of hooks do you make use of?
  8. Are there any ops issues you encountered? (Scaling, unforeseen downtime, etc.)
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active November 1, 2024 17:40
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@johnweldon
johnweldon / start-sshagent
Created December 20, 2011 00:43
powershell script to start the ssh-agent
$ gcm start-sshagent | fl
Name : start-sshagent
CommandType : Function
Definition :
if($env:SSH_AGENT_PID) { echo "ssh-agent running"; return }
$private:gp = get-gitbinpath
if($private:gp) {
$private:out = & (join-path $private:gp "ssh-agent")