Listing posts

Displaying posts 1 - 5 of 328 in total
Firefox personalizations attachment
mouse 4125 · person cloud · link
Last update
2024-05-20
2024
05-20
«browser apps/addons/plugins»

Firefox user interface

From mozilla forum:

  1. in about:config set toolkit.legacyUserProfileCustomizations.stylesheets = true
  2. clone & install custom CSS from https://github.com/aris-t2/customcssforfx
  3. uncomment @import "./css/tabs/tabs_below_navigation_toolbar_fx89.css";
  4. cd firefox_profile && rm -rf chrome && ln -sf /path/to/repo/current

My about:config settings

  • browser.download.alwaysOpenPanel = false -- fix naggin download panel since FF 98
  • browser.tabs.loadDivertedInBackground = true @
  • security.dialog_enable_delay = 100 @
  • set a custom user agent:

    1. Add new string value general.useragent.override
    2. Enter your preferred UA
    3. Check it on https://www.whatsmyua.info/

    This is especially useful if you are on an ARM device (like raspberry pi) and google keeps giving you its mobile version, for example:

    1
    2
    Mozilla/5.0 (X11; Linux armv7l; rv:60.0) Gecko/20100101 Firefox/60.0    # before
    Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0    # after
    

Add-ons

old:


Source: userChrome.org, CustomCSSforFx


~~~ * ~~~

Git sign commits and tags
mouse 62 · person cloud · link
Last update
2024-04-18
2024
04-18
«github sign verification»

upload public ssh key to github

Settings > SSH and GPG keys > New SSH key > Key type = signing key > paste you public key

configure signing via SSH key

1
2
git config  gpg.format       ssh
git config  user.signingkey  ~/.ssh/id_ed25519  # private key

configure automatic signing

1
2
3
4
5
6
git config  commit.gpgSign  true
git config  tag.gpgSign     true

# create allowed keys list
git config  gpg.ssh.allowedSignersFile  .git/ssh_signers
echo "username@users.noreply.github.com `cat ~/.ssh/id_ed25519`" > .git/ssh_signers

verify signature in log

1
2
git config --global alias.logs 'log --show-signature'
git logs

optional: change all commits' email (w/o history change)

1
2
git config  user.email  "username@users.noreply.github.com"
git -c rebase.instructionFormat='%s%nexec GIT_COMMITTER_DATE="%cD" GIT_AUTHOR_DATE="%aD" git commit --amend --no-edit --reset-author' rebase -f --root

optional: sign all commits (w/o history change)

1
git filter-branch --commit-filter 'git commit-tree -S "$@";' -- --all

Note: filter-branch will strip signature in tags, you have to sign your tags again

1
`git tag`.split("\n").each{|t| system %Q|GIT_COMMITTER_DATE="$(git log -1 --format=%aD #{t})" git tag #{t} #{t}^{} -f -s -m #{t}|}; nil

push changes to remote overwriting everything

1
2
git push -f
git push -f --tags

Source: allowed keys list, change email respecting privacy, sign previous commits + gist, github verification / key / commits / tags


~~~ * ~~~

SSH tunnel howto and hints attachment
mouse 2596 · person cloud · link
Last update
2024-04-06
2024
04-06
«relevant things about ssh tunnels, netcat port knocking»

A general tunnel command:

1
2
3
4
5
6
7
8
9
10
11
12
13
ssh myuser@mysrv
  -L   8080:localhost:80  # tunnel local_port:target:target_port
  -L *:8080:localhost:80  # tunnel open to everyone who can connect to this machine
  -R   3380:localhost:80  # reverse tunnel port_on_mysrv:target:target_port
  -R *:3322:localhost:22  # reverse tunnel open to everyone who can connect to mysrv
  -q # quiet mode
  -f # go to background
  -n # redirects stdin from /dev/null
  -N # do not execute a remote command
  -T # disable pseudo-terminal allocation
  -M -S /path/to/socket # enable master mode via a shared socket
  -o UserKnownHostsFile=/dev/null # do not update known_hosts file
  -o StrictHostKeyChecking=no     # do no check the empty known_hosts file

Note: to allow the creation of reverse tunnels opened to everyone (0.0.0.0) you have to set this option:

1
2
# server configuration: /etc/ssh/sshd_config
GatewayPorts clientspecified

Scriptable tunnels

You can look for process IDs via pgrep/pkill:

1
2
ssh -fnNT ... mysrv          # start
pkill -f -QUIT 'ssh.*mysrv'  # stop

or better use master mode to avoid both grepping and any timing issues:

1
2
3
ssh -fNM -S /path/to/socket ... mysrv  # start
ssh -S /path/to/socket -O check        # check
ssh -S /path/to/socket -O exit mysrv   # stop

Auto-closing tunnels

SSH runs the specified command and then exits only if no one is using the tunnel:

1
2
ssh -f myusr@mysrv sleep 10  # start auto-closing tunnel
vncviewer 127.0.0.1::25901   # use the tunnel

Keep alive your connection

Keep alive the connection for 60 seconds, 1440 times (= 24 hours):

1
2
3
4
# client configuration: /etc/ssh/ssh_config | ~/.ssh/config
Host *
  ServerAliveInterval 60
  ServerAliveCountMax 1440
1
2
3
# server configuration: /etc/ssh/sshd_config
ClientAliveInterval 60
ClientAliveCountMax 1440

Test connectivity

1
ssh -o BatchMode=yes -o ConnectTimeout=3 myusr@mysrv exit && echo ok || echo ko

List active tunnels and ports

1
sudo lsof -i -n | egrep sshd

Port knocking

1
2
3
4
5
6
7
# ip4, scan, UDP, verbose
nc -4znuv hostname_or_ip port1 port2 ...

# with wait interval
nc -4znuv hostname_or_ip port1 && sleep 1 && \
nc -4znuv hostname_or_ip port2 && sleep 1 && \
...

Source: Stackexchange - master mode, Patrickmn - keep alive, Stackoverflow - test, Superuser - list active tunnels


~~~ * ~~~

micro editor settings
mouse 165 · person cloud · link
Last update
2024-03-26
2024
03-26
« — »

install fileamanger plugin

1
2
3
4
5
6
7
8
# install official plugin (open in new split window via Tab key)
micro -plugin install filemanager

# or install custom version (open in new tab via Enter key)
mkdir -p ~/.config/micro/plug/filemanager/
cd ~/.config/micro/plug/filemanager/
wget https://github.com/acavalin/updated-plugins/raw/master/filemanager-plugin/filemanager.lua
wget https://github.com/acavalin/updated-plugins/raw/master/filemanager-plugin/syntax.yaml

~/.config/micro/settings.json

1
2
3
4
5
6
7
8
9
10
{
  "colorcolumn": 80,
  "colorscheme": "railscast",
  "filemanager.openontab": true,
  "filemanager.showdotfiles": false,
  "filemanager.showignored": false,
  "mouse": false,
  "tabsize": 2,
  "tabstospaces": true
}

NB: add "clipboard": "internal" when external is unavailable

~/.config/micro/bindings.json

1
2
3
4
5
6
7
8
9
10
11
{
  "Alt-/": "lua:comment.comment",
  "Alt-h": "command:setlocal filetype shell",
  "Ctrl-d": "lua:comment.comment",
  "Ctrl-o": "lua:filemanager.toggle_tree",
  "Ctrl-w": "Quit",
  "Alt-w": "NextSplit",
  "Ctrl-q": "QuitAll",
  "Alt-Ctrl-f": "command-edit:replace s d",
  "CtrlUnderscore": "lua:comment.comment"
}

resizing window splits

See this comment, resize plugin and key bindings:

1
2
3
4
5
6
{
  "Alt-A": "command:shrink_X",
  "Alt-D": "command:grow_X",
  "Alt-S": "command:grow_Y",
  "Alt-W": "command:shrink_Y"
}

See also: gh, discord, keybindings official & gist


~~~ * ~~~

Videogames price trackers
mouse 94 · person cloud · link
Last update
2024-03-22
2024
03-22
«gaming deals»