Skip to content

Instantly share code, notes, and snippets.

View kulak's full-sized avatar

Sergei Gnezdov kulak

View GitHub Profile

The Freenode resignation FAQ, or: "what the fuck is going on?"

IMPORTANT NOTE:

It's come to my attention that some people have been spamming issue trackers with a link to this gist. While it's a good idea to inform people of the situation in principle, please do not do this. By all means spread the word in the communities that you are a part of, after verifying that they are not aware yet, but unsolicited spam is not helpful. It will just frustrate people.

Update 3 (May 24, 2021)

A number of things have happened since the last update.

@ozbillwang
ozbillwang / kubernetes-auto-completion-fish.md
Last active March 28, 2024 18:46
Kubernetes auto-completion works with FISH (better than Bash)
@m-rey
m-rey / fix_pgp_pub_key_not_found.sh
Created March 1, 2019 14:25
Fix: Public Key of Ultimately Trusted Key $key Not Found
#!/bin/bash
gpg --check-trustdb 2>&1| grep 'not found' | awk '{print $8}' >bad-keys.txt
gpg --export-ownertrust > ownertrust-gpg.txt
mv ~/.gnupg/trustdb.gpg ~/.gnupg/trustdb.gpg-broken
for KEY in `cat bad-keys.txt` ; do sed -i "/$KEY/d" ownertrust-gpg.txt ; done
gpg --import-ownertrust ownertrust-gpg.txt
rm bad-keys.txt ownertrust-gpg.txt
@corny
corny / sshtunnel.go
Last active August 27, 2021 22:54 — forked from iamralch/sshtunnel.go
SSH tunnelling in Golang
package main
import (
"fmt"
"io"
"io/ioutil"
"log"
"net"
"os"
@fikovnik
fikovnik / getxkblayout.c
Created February 7, 2018 09:43
Get keyboard layout using X11
// compile with `gcc -I/usr/include getxkblayout.c -lX11 -lxkbfile`
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <X11/XKBlib.h>
#include <X11/extensions/XKBrules.h>
int main(int argc, char **argv) {
Display *dpy = XOpenDisplay(NULL);
@kestein
kestein / Private_Crates.md
Last active March 28, 2024 10:36
Linking to a private repo in Cargo.toml

Under the dependencies section, put

<crate name>={git="ssh://git@github.com/<organization>/<reponame>.git"}

It is pretty similar to a github repo's ssh cloning link, however the : is replaced with a / and ssh:// is prepended to the URL.

git@github.com:my-organization/my-repo.git vs ssh://git@github.com/my-organization/my-repo.git

The SSH URL needs to be used because Cargo is currently unable to handle the authentication prompt that comes up when an HTTPS link is used.
Make sure that the matches the crate name in the target repo's Cargo.toml. The repo name will not override what is in the Cargo.toml if it is a different value.

@aight8
aight8 / react-table.d.ts
Created May 23, 2017 22:29
@types/react-table/index.d.ts
declare module 'react-table' {
const val: ReactTable
export default val
}
declare module ReactTable {
import * as React from 'react'
type AccessorFunction = (row: object) => any
type Accessor = string | string[] | object | AccessorFunction
@atoponce
atoponce / README.md
Last active December 20, 2023 18:39
Security settings for WeeChat

Strongly Recommended

Disable DCC

/plugin unload xfer
/set weechat.plugin.autoload *,!xfer

Disable CTCP

/set irc.ctcp.action ""
/set irc.ctcp.clientinfo ""
/set irc.ctcp.finger ""

/set irc.ctcp.ping ""

@jcberthon
jcberthon / networkmanager-wifi-powersave.md
Last active April 22, 2024 14:33
NetworkManager Wi-Fi powersaving configuration

NetworkManager WiFi Power Saving

NetworkManager supports WiFi powersaving but the function is rather undocumented.

From the source code: wifi.powersave can have the following value:

  • NM_SETTING_WIRELESS_POWERSAVE_DEFAULT (0): use the default value
  • NM_SETTING_WIRELESS_POWERSAVE_IGNORE (1): don't touch existing setting
  • NM_SETTING_WIRELESS_POWERSAVE_DISABLE (2): disable powersave
@rjz
rjz / redux-actions-with-typescript-discriminated-unions.ts
Created September 29, 2016 16:00
Redux actions using TypeScript discriminated unions
// Redux actions using TypeScript discriminated unions
//
// Source: https://github.com/rjz/typescript-react-redux/
// Actions
export type Action =
{ type: 'INCREMENT_COUNTER', delta: number }
| { type: 'RESET_COUNTER' }