Skip to content

Instantly share code, notes, and snippets.

@SietsevanderMolen
SietsevanderMolen / qubes_i3status.sh
Last active May 8, 2024 12:44
Feeds i3bar with current Qubes system status
#!/bin/bash
# By @minad and @SietsevanderMolen
WIFI_VM="sys-net"
json() {
if [[ -n "$3" ]]; then
echo -n "{\"name\":\"$1\",\"color\":\"$3\",\"full_text\":\"$2\"},"
else
echo -n "{\"name\":\"$1\",\"full_text\":\"$2\"},"
@SietsevanderMolen
SietsevanderMolen / qubes_autostart_xdg.sh
Created May 22, 2016 10:52
Start all entries in xdg autostart dir
autostart_etc=${XDG_CONFIG_DIRS-/etc/xdg}/autostart
autostart_home=${XDG_CONFIG_HOME-~/.config}/autostart
shopt -s nullglob
for i in $autostart_etc/*.desktop $autostart_home/*.desktop; do
if ! grep -q "OnlyShowIn=" "$i"; then
$(grep "Exec=" "$i" | sed 's/Exec=//') &
fi
done
@SietsevanderMolen
SietsevanderMolen / qubes_domain_terminal.sh
Last active May 8, 2024 12:43
Opens a terminal in the domain belonging to the current active winow
#!/bin/bash
run_terminal='
for t in $TERMINAL urxvt rxvt terminator Eterm aterm xterm gnome-terminal roxterm xfce4-terminal; do
which $t > /dev/null 2>&1 && exec $t;
done
'
get_id() {
local id=$(xprop -root _NET_ACTIVE_WINDOW)
@taulant
taulant / fjalori-i-shqipes-se-sotme-1980.json
Last active May 8, 2024 12:42
Fjalor i Shqipes se sotme (1980) - Akademia e Shkencave e RPS të Shqipërisë: Instituti i Gjuhësisë dhe i Letërsisë
This file has been truncated, but you can view the full file.
{
"dictionary": {
"abazhur": {
"word": "Abazhur",
"description": ",~I m. sh. ~\u00cb, ~\u00cbT. Mbules\u00eb prej qelqi, prej metali ose prej nj\u00eb l\u00ebnde tjet\u00ebr, q\u00eb sh\u00ebrben p\u00ebr ta mbledhur drit\u00ebn e llamb\u00ebs elektrike n\u00eb nj\u00eb drejtim, p\u00ebr t\u00eb mbrojtur syt\u00eb nga drita e forte ose p\u00ebr zbjilcurim; mb\u00ebshtet\u00ebsja p\u00ebr llamb\u00ebn bashk\u00eb me k\u00ebt\u00eb mbules\u00eb."
},
"abc": {
"word": "Abc",
"description": "[lexo: ab\u00ebc\u00eb], ~JA . shih AB\u00cbC\u00cb,~JA. Abc-ja e shqipes. Abc-ja e edukat\u00ebs. M\u00ebsoj abc-n\u00eb."

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?

@luidgigromat
luidgigromat / Enable soft-wrap for Visual Studio Code.txt
Last active May 8, 2024 12:41
Enable soft-wrap for Visual Studio Code
1. Open VS Code
2. Press Ctrl + Ship + P
3. Type "settings" and choose "Preference : Open settings (UI)"
4. Search the following settings : "word wrap"
5. Set "Editor: Word Wrap" to "ON"
@ryancdavison
ryancdavison / iPad-Pro-Magic-Keyboard-Portrait-Mode-DIY-Smart-Connector-Cable.md
Last active May 8, 2024 12:40
iPad Pro 12.9 (2020) Magic Keyboard Portrait Mode DIY Smart Connector Cable

iPad Pro 12.9" (2020) Magic Keyboard Portrait Mode DIY Smart Connector Cable

I wanted my iPad Pro to be able to use the Magic Keyboard in portrait mode, but the current Smart Connector configuration does not allow this. With too much time on my hands, I made a short jumper cable using a section of USB cable, 5-pin POGO connectors (the 5-pin works using pins 1, 3, and 5, and removing pins 2 and 4), a small electrical project box, 3mm N52 magnets, and some epoxy and Sugru to pack everything into place. My cable and connections orientation had more to do with the boxes I found to encase the connector (with holes on the small end) than anything else. Obviously, there will be many ways to do this.

WARNING: Getting any of these steps wrong will probably ruin your iPad.

Note: These measurements are for the 12.9" (2020) model. The magnets did not line up and the polarity was different for my wife's iPad Pro 11" (2021).

![iPad-Pro-MmagicKeyboard-Jumper-Cable-min](https://user-images.githubusercontent.c

@karoltheguy
karoltheguy / forloop.bat
Last active May 8, 2024 12:40
Batch file for loop csv
@for /F "tokens=1,2,3 skip=1 delims=," %%A in (test.txt) do (
@echo I am at %%A using login %%B:%%C
)
@ibrahimlawal
ibrahimlawal / LC_CTYPE.txt
Created February 27, 2017 07:02 — forked from jampajeen/LC_CTYPE.txt
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@ibrahimsn98
ibrahimsn98 / jwt-expiration.md
Created February 8, 2019 13:18 — forked from soulmachine/jwt-expiration.md
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC: