Skip to content

Instantly share code, notes, and snippets.

View sozercan's full-sized avatar
:shipit:
I may be slow to respond.

Sertaç Özercan sozercan

:shipit:
I may be slow to respond.
View GitHub Profile
#!/usr/bin/env bash
set -u
: "${PREFIX:=/usr/local}"
PATH="${PREFIX}/go/bin:${PATH}"
if ! command -v jq > /dev/null; then
echo "Installing jq" >&2
@cpuguy83
cpuguy83 / debug.sh
Created July 31, 2023 22:51
Debugging stuff
set -e
prev_cmd=""
this_cmd=""
prev_line=""
this_line=""
debug_trap() {
prev_cmd="${this_cmd}"
this_cmd="${BASH_COMMAND}"
prev_line="${this_line}"
@alexeldeib
alexeldeib / deploy.sh
Last active October 21, 2022 22:26
AKS wasm demo
# need an ingress controller ideally
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.4.0/deploy/static/provider/cloud/deploy.yaml
# wait a bit for nginx ip allocation...
IP="$(kubectl -n ingress-nginx get svc -o jsonpath="{.status.loadBalancer.ingress[0].ip}" ingress-nginx-controller)"
# apply workloads + runtimes
kubectl apply -f wasm.yaml
curl -v http://$IP/spin/hello
@webdevsuperfast
webdevsuperfast / zsh.md
Last active July 26, 2024 15:53
Install ZSH using Homebrew and set as default shell in Linux/WSL

Install ZSH via HomeBrew

brew install zsh

Add ZSH to /etc/shells

echo $(which zsh) | sudo tee -a /etc/shells

Set ZSH as default user shell

sudo chsh -s $(which zsh) $USER

Execute Shell or just restart terminal to take effect

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export your tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@anaisbetts
anaisbetts / stat-cache.js
Last active April 11, 2019 05:07
Make your Electron apps load faster, with this One Weird Trick
// Include this at the very top of both your main and window processes, so that
// it loads as soon as possible.
//
// Why does this work? The node.js module system calls fs.realpathSync a _lot_
// to load stuff, which in turn, has to call fs.lstatSync a _lot_. While you
// generally can't cache stat() results because they change behind your back
// (i.e. another program opens a file, then you stat it, the stats change),
// caching it for a very short period of time is :ok: :gem:. These effects are
// especially apparent on Windows, where stat() is far more expensive - stat()
// calls often take more time in the perf graph than actually evaluating the
@jonstodle
jonstodle / UniformWidthWrapPanel.cs
Last active April 13, 2019 21:48
A panel which arranges it's children into the specified amount of columns and stretches them to uniformly consume the whole width
using System;
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace KodeFisk
{
public class UniformWidthWrapPanel : Panel
{
public UniformWidthWrapPanel()
@denvazh
denvazh / README.md
Last active July 30, 2024 11:28
Scheduled update for homebrew

Scheduled updates for homebrew

This two launchdaemon scripts provide scheduled updates and upgrade for homebrew packages.

It will run in the following way:

  • brew update every day at 12:10
  • brew upgrade every day at 12:20

How to install