Skip to content

Instantly share code, notes, and snippets.

View jonasbn's full-sized avatar
🤚
keeping my distance

Jonas Brømsø jonasbn

🤚
keeping my distance
View GitHub Profile
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution
Last active April 17, 2024 07:01
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.
#!/bin/sh
echo "# 24-bit (true-color)"
# based on: https://gist.github.com/XVilka/8346728
term_cols="$(tput cols || echo 80)"
cols=$(echo "2^((l($term_cols)/l(2))-1)" | bc -l 2> /dev/null)
rows=$(( cols / 2 ))
awk -v cols="$cols" -v rows="$rows" 'BEGIN{
s=" ";
m=cols+rows;
@chrodriguez
chrodriguez / dockerhub-readme-update.sh
Last active November 10, 2022 21:39
How to update dockerhub readme automatically
#!/bin/bash
usage() {
if [ ! -z $1 ]; then
echo -e "ERROR:\n" 1>&2
fi
echo "Usage: $0 -f /path/to/README.md -u dockerhub-username [-r dockerhub-repo-prefix] -n repo-name" 1>&2
exit 1;
}
while getopts ":r:u:f:n:" o; do
@Tekki
Tekki / mojo-vue.pl
Last active April 26, 2021 16:24
Mojolicious - Vue.js Example
#!/usr/bin/env perl
use Mojolicious::Lite -signatures;
get '/' => sub ($c) {
$c->render(template => 'index');
};
get '/api/:region' => sub ($c) {
my %regions = (
@inadarei
inadarei / minikube-sierra.md
Last active October 20, 2020 01:57
Minikube Setup: Docker for Mac / Sierra

Prerequisite: latest Docker for Mac on MacOS Sierra

$ brew update
$ brew install --HEAD xhyve
$ brew install docker-machine-driver-xhyve
$ sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
$ sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve

$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.18.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
FROM perl
WORKDIR /perl
ENTRYPOINT ["carton", "exec"]
RUN cpanm -n Carton
COPY tarball.tgz /perl
RUN cd /perl && tar zxf tarball.tgz && carton install --deployment
@henrik
henrik / macos_sierra_upgrade.md
Last active February 28, 2017 21:25
macOS Sierra update: Ruby, Rails, homebrew, VirtualBox/Vagrant, Elixir etc.

My notes from updating to macOS Sierra, as a Ruby/Rails developer working in VirtualBox/Vagrant.

Homebrew

brew doctor told me to fix /usr/local ownership:

sudo chown -R $(whoami) /usr/local

It also said Error: Failure while executing: /usr/bin/otool -L /usr/bin/install_name_tool.

@tara-gibbs
tara-gibbs / hey
Last active August 26, 2018 13:27
Handy OS X notification util to alert you with notification and speech that a long running process has completed.
#!/bin/bash
/usr/bin/osascript -e "display notification \"$*\" with title \"Hey!\""
/usr/bin/say -v Alex "Hey! $*"
# Setup: Add this to your /usr/local/bin in a file called hey. chmod +x it to make it an executable.
# Usage: sleep 2 && hey wake up!
@olih
olih / jq-cheetsheet.md
Last active April 20, 2024 06:34
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@lukas-h
lukas-h / license-badges.md
Last active April 21, 2024 09:35
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)