Skip to content

Instantly share code, notes, and snippets.

@konfou
konfou / README.md
Created April 1, 2021 20:07
Fix gksqt error when plotting with Julia on NixOS

TL;DR Run julia-fix-gksqt.sh, then nix-shell julia-fix-gksqt.nix --run julia.

If you're running NixOS and trying to plot something in Julia you're probably getting the following error (where kon will and 9Vi4m may differ)

sh: /home/kon/.julia/packages/GR/9Vi4m/src/../deps/gr/bin/gksqt: No such file or directory
connect: Connection refused
GKS: can't connect to GKS socket application
@konfou
konfou / mkvextract-helper.sh
Last active March 3, 2024 15:29
extract all tracks/attachments/chapters from an mkv file
#!/usr/bin/env bash
#
# Extract all tracks/attachments/chapters from an mkv file.
# depends
type -p mkvmerge &>/dev/null || exit 3
type -p mkvextract &>/dev/null || exit 3
# trap SIGINT
trap 'trap - INT; kill -s INT "$$"' INT
@konfou
konfou / compile_MathLink_linux.sh
Last active February 8, 2023 17:58 — forked from xrq-phys/compile_MathLink_linux.sh
Compile Wolfram Engine Backend for TeXmacs on Linux (Nix)
@konfou
konfou / OmniCode
Created July 24, 2013 11:32
An alternative to Geek Code, by Greg Webster (see README.md).
OmniCode! version 0.1.7
Description for the New Net
All codes are built in the following way:
[code symbol][attribute].[modifier].[modifier].[modifier]...
or for multiple codes:
[code symbol][attribute].[modifier]&[attribute].[modifier]...
@konfou
konfou / andro_info.sh
Created September 13, 2015 18:11
Android Device Specifications
#! /bin/bash
if ! type adb; then
echo "adb not found"
echo "check PATH"
else
echo "============================"
echo "Android Device Specificatios"
echo "============================"
adb wait-\for-device
echo "> Manufacturer"
@konfou
konfou / README.md
Last active March 21, 2021 17:03
fake sudo bash script
number description authors status
0 Feature-based conditional expansion construct Marc Feeley final
1 List Library Olin Shivers final
2 AND-LET* Oleg Kiselyov final
3 List-Set Library Olin Shivers withdrawn
4 Homogeneous numeric vector datatypes Marc Feeley final
5 A compatible let form with signatures and rest arguments Andy Gaynor final
6 Basic String Ports William D Clinger final
7 Feature-based program configuration language Richard Kelsey final
"""
@do begin
body
end when condition
Macro emulating a do-until construct.
"""
@eval macro $(:do)(body, when::Symbol, condition)
quote
while true
@konfou
konfou / README.md
Last active July 2, 2020 18:43
play-with-mpv youtube-dl compatible sites

The following files have been adapted from ViewTube userscript 'protocol' [[1]] instructions. But I find no reason using such a complex script just for opening a video to mpv, so instead I opted out to using a bookmarklet. The files may be installed as follows:

user$ mkdir -p $HOME/.local/{bin,share/applications}
user$ cp notube.desktop $HOME/.local/share/applications/notube.desktop
user$ install -D -m 755 notube.sh $HOME/.local/bin/notube.sh
user$ xdg-mime default notube.desktop x-scheme-handler/notube
@konfou
konfou / fs_fb_pic.js
Created August 8, 2013 17:19
Bookmarklet that turns an opened Facebook picture to its full size.
javascript:location.href=window.location.href.replace(/\/s\d{3}x\d{3}\//g,%20"/");