···11+/* This is Sprinkles' global.css.
22+ *
33+ * The styles you add here will be added to every page you visit.
44+ *
55+ * To add styles specific to a single domain, create files in this directory, named
66+ * after the (full) domain, eg. "twitter.com.css" or "subdomain.example.com.css".
77+ *
88+ * For example, uncomment the line below to get an extra creamy web experience: */
99+1010+/* body { background-color: papayawhip; } */
+14
.config/sprinkles/global.js
···11+// This is Sprinkles' global.js.
22+//
33+// The JavaScript code you add here will be run on every page you visit.
44+//
55+// To add scripts specific to a single domain, create files in this directory, name
66+// after the domain, eg. "twitter.com.js" or "subdomain.example.com.js".
77+//
88+// For example, uncomment the lines below to change every image on the web to random new one:
99+1010+// for (const elm of document.querySelectorAll("img")) {
1111+// elm.src = `//picsum.photos/${elm.width}`
1212+// }
1313+1414+console.log("sprinkles running")
···11+console.log("Optimized Mycecurity sprinkle is running.");
22+("this is pretty cool");
33+44+/**
55+ * Finds and formats ISO date strings within a given DOM node and its children.
66+ * @param {Node} node The root node to search within.
77+ */
88+function formatDatesWithinNode(node) {
99+ // 1. Ensure the node is an element we can query.
1010+ // This filters out text nodes, comments, etc.
1111+ if (!(node instanceof Element)) {
1212+ return;
1313+ }
1414+1515+ // 2. Create a list of candidates to check:
1616+ // - The node itself (if it's a potential candidate).
1717+ // - All descendant elements that could contain a date.
1818+ const candidates = [node, ...node.querySelectorAll("div, span, p, td")];
1919+2020+ // 3. Filter the candidates to find only the ones with parsable dates.
2121+ const dateElements = candidates.filter(
2222+ (el) => el.textContent && !isNaN(Date.parse(el.textContent.trim())),
2323+ );
2424+2525+ // 4. Loop through and format the valid date elements.
2626+ for (const element of dateElements) {
2727+ // Skip elements we have already formatted to prevent errors.
2828+ if (element.dataset.formatted) continue;
2929+3030+ const originalDate = element.textContent.trim();
3131+ element.textContent = new Date(originalDate).toLocaleDateString(
3232+ "fr-FR",
3333+ {
3434+ year: "numeric",
3535+ month: "numeric",
3636+ day: "numeric",
3737+ },
3838+ );
3939+4040+ // Mark the element as formatted.
4141+ element.dataset.formatted = "true";
4242+ }
4343+}
4444+4545+// Create an observer that will run our function on specific added nodes.
4646+const observer = new MutationObserver((mutationsList) => {
4747+ for (const mutation of mutationsList) {
4848+ // We only care about 'childList' mutations (nodes being added/removed).
4949+ if (mutation.type === "childList") {
5050+ // For every node that was added, run our formatting function on it.
5151+ for (const addedNode of mutation.addedNodes) {
5252+ formatDatesWithinNode(addedNode);
5353+ }
5454+ }
5555+ }
5656+});
5757+5858+// Start observing the entire body for changes to its descendants.
5959+observer.observe(document.body, {
6060+ childList: true,
6161+ subtree: true,
6262+});
6363+6464+// Finally, run the function once on the entire body for the initial page load.
6565+formatDatesWithinNode(document.body);
···11+# : << EOF
22+# Oh my tmux!
33+# 💛🩷💙🖤❤️🤍
44+# https://github.com/gpakosz/.tmux
55+# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
66+# without any warranty.
77+# Copyright 2012— Gregory Pakosz (@gpakosz).
88+99+1010+# -- Backup/Restore sessions
1111+1212+set -g @plugin 'tmux-plugins/tmux-resurrect'
1313+set -g @plugin 'tmux-plugins/tmux-continuum'
1414+set -g @continuum-restore 'on' # Auto-restore on tmux start
1515+1616+1717+1818+# -- bindings ------------------------------------------------------------------
1919+2020+# preserve tmux stock bindings,
2121+# while adding bindings that don't conflict with these stock bindings
2222+# /!\ this disables some of Oh my tmux! bindings described in README.md
2323+# - true
2424+# - false (default)
2525+tmux_conf_preserve_stock_bindings=false
2626+2727+2828+# -- session creation ----------------------------------------------------------
2929+3030+# prompt for session name when creating a new session, possible values are:
3131+# - true
3232+# - false (default)
3333+# - disabled (do not modify new-session bindings)
3434+tmux_conf_new_session_prompt=false
3535+3636+# new session retains current path, possible values are:
3737+# - true
3838+# - false (default)
3939+# - disabled (do not modify new-session bindings)
4040+tmux_conf_new_session_retain_current_path=false
4141+4242+4343+# -- windows & pane creation ---------------------------------------------------
4444+4545+# new window retains current path, possible values are:
4646+# - true
4747+# - false (default)
4848+# - disabled (do not modify new-window bindings)
4949+tmux_conf_new_window_retain_current_path=false
5050+5151+# new window tries to reconnect ssh sessions, possible values are:
5252+# - true
5353+# - false (default)
5454+# - disabled (do not modify new-window bindings)
5555+tmux_conf_new_window_reconnect_ssh=false
5656+5757+# new pane retains current path, possible values are:
5858+# - true (default)
5959+# - false
6060+# - disabled (do not modify split-window bindings)
6161+tmux_conf_new_pane_retain_current_path=true
6262+6363+# new pane tries to reconnect ssh sessions, possible values are:
6464+# - true
6565+# - false (default)
6666+# - disabled (do not modify split-window bindings)
6767+tmux_conf_new_pane_reconnect_ssh=false
6868+6969+7070+# -- display -------------------------------------------------------------------
7171+7272+# RGB 24-bit colour support, possible values are:
7373+# - true
7474+# - false
7575+# - auto (default)
7676+#
7777+# automatic detection relies on the COLORTERM environment variable being defined
7878+# to 'truecolor' or '24bit' or '$ tput colors' answering '16777216'
7979+# see https://github.com/termstandard/colors
8080+tmux_conf_24b_colour=auto
8181+8282+8383+# -- theming -------------------------------------------------------------------
8484+8585+# enable or disable theming:
8686+# - enabled (default)
8787+# - disabled
8888+# when disabled, all tmux_conf_theme_xxx variables are ignored except:
8989+# - tmux_conf_theme_pairing
9090+# - tmux_conf_theme_prefix
9191+# - tmux_conf_theme_mouse
9292+# - tmux_conf_theme_root
9393+# - tmux_conf_theme_synchronized
9494+tmux_conf_theme=enabled
9595+9696+# default theme
9797+tmux_conf_theme_colour_1="#080808" # dark gray
9898+tmux_conf_theme_colour_2="#303030" # gray
9999+tmux_conf_theme_colour_3="#8a8a8a" # light gray
100100+tmux_conf_theme_colour_4="#00afff" # light blue
101101+tmux_conf_theme_colour_5="#ffff00" # yellow
102102+tmux_conf_theme_colour_6="#080808" # dark gray
103103+tmux_conf_theme_colour_7="#e4e4e4" # white
104104+tmux_conf_theme_colour_8="#080808" # dark gray
105105+tmux_conf_theme_colour_9="#ffff00" # yellow
106106+tmux_conf_theme_colour_10="#ff00af" # pink
107107+tmux_conf_theme_colour_11="#5fff00" # green
108108+tmux_conf_theme_colour_12="#8a8a8a" # light gray
109109+tmux_conf_theme_colour_13="#e4e4e4" # white
110110+tmux_conf_theme_colour_14="#080808" # dark gray
111111+tmux_conf_theme_colour_15="#080808" # dark gray
112112+tmux_conf_theme_colour_16="#d70000" # red
113113+tmux_conf_theme_colour_17="#e4e4e4" # white
114114+115115+# default theme (ansi)
116116+#tmux_conf_theme_colour_1="colour0"
117117+#tmux_conf_theme_colour_2="colour8"
118118+#tmux_conf_theme_colour_3="colour8"
119119+#tmux_conf_theme_colour_4="colour14"
120120+#tmux_conf_theme_colour_5="colour11"
121121+#tmux_conf_theme_colour_6="colour0"
122122+#tmux_conf_theme_colour_7="colour15"
123123+#tmux_conf_theme_colour_8="colour0"
124124+#tmux_conf_theme_colour_9="colour11"
125125+#tmux_conf_theme_colour_10="colour13"
126126+#tmux_conf_theme_colour_11="colour10"
127127+#tmux_conf_theme_colour_12="colour8"
128128+#tmux_conf_theme_colour_13="colour15"
129129+#tmux_conf_theme_colour_14="colour0"
130130+#tmux_conf_theme_colour_15="colour0"
131131+#tmux_conf_theme_colour_16="colour1"
132132+#tmux_conf_theme_colour_17="colour15"
133133+134134+# window style
135135+tmux_conf_theme_window_fg="default"
136136+tmux_conf_theme_window_bg="default"
137137+138138+# highlight focused pane, possible values are:
139139+# - true
140140+# - false (default)
141141+tmux_conf_theme_highlight_focused_pane=false
142142+143143+# focused pane colours:
144144+tmux_conf_theme_focused_pane_bg="$tmux_conf_theme_colour_2"
145145+146146+# pane border style, possible values are:
147147+# - thin (default)
148148+# - fat
149149+tmux_conf_theme_pane_border_style=thin
150150+151151+# pane borders colours:
152152+tmux_conf_theme_pane_border="$tmux_conf_theme_colour_2"
153153+tmux_conf_theme_pane_active_border="$tmux_conf_theme_colour_4"
154154+%if #{>=:#{version},3.2}
155155+tmux_conf_theme_pane_active_border="#{?pane_in_mode,$tmux_conf_theme_colour_9,#{?synchronize-panes,$tmux_conf_theme_colour_16,$tmux_conf_theme_colour_4}}"
156156+%endif
157157+158158+# pane indicator colours (when you hit <prefix> + q)
159159+tmux_conf_theme_pane_indicator="$tmux_conf_theme_colour_4"
160160+tmux_conf_theme_pane_active_indicator="$tmux_conf_theme_colour_4"
161161+162162+# status line style
163163+tmux_conf_theme_message_fg="$tmux_conf_theme_colour_1"
164164+tmux_conf_theme_message_bg="$tmux_conf_theme_colour_5"
165165+tmux_conf_theme_message_attr="bold"
166166+167167+# status line command style (<prefix> : Escape)
168168+tmux_conf_theme_message_command_fg="$tmux_conf_theme_colour_5"
169169+tmux_conf_theme_message_command_bg="$tmux_conf_theme_colour_1"
170170+tmux_conf_theme_message_command_attr="bold"
171171+172172+# window modes style
173173+tmux_conf_theme_mode_fg="$tmux_conf_theme_colour_1"
174174+tmux_conf_theme_mode_bg="$tmux_conf_theme_colour_5"
175175+tmux_conf_theme_mode_attr="bold"
176176+177177+# status line style
178178+tmux_conf_theme_status_fg="$tmux_conf_theme_colour_3"
179179+tmux_conf_theme_status_bg="$tmux_conf_theme_colour_1"
180180+tmux_conf_theme_status_attr="none"
181181+182182+# terminal title
183183+# - built-in variables are:
184184+# - #{circled_window_index}
185185+# - #{circled_session_name}
186186+# - #{hostname}
187187+# - #{hostname_ssh}
188188+# - #{hostname_full}
189189+# - #{hostname_full_ssh}
190190+# - #{username}
191191+# - #{username_ssh}
192192+tmux_conf_theme_terminal_title="#h ❐ #S ● #I #W"
193193+194194+# window status style
195195+# - built-in variables are:
196196+# - #{circled_window_index}
197197+# - #{circled_session_name}
198198+# - #{hostname}
199199+# - #{hostname_ssh}
200200+# - #{hostname_full}
201201+# - #{hostname_full_ssh}
202202+# - #{username}
203203+# - #{username_ssh}
204204+tmux_conf_theme_window_status_fg="$tmux_conf_theme_colour_3"
205205+tmux_conf_theme_window_status_bg="$tmux_conf_theme_colour_1"
206206+tmux_conf_theme_window_status_attr="none"
207207+tmux_conf_theme_window_status_format="#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}"
208208+#tmux_conf_theme_window_status_format="#{circled_window_index} #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}"
209209+#tmux_conf_theme_window_status_format="#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}"
210210+211211+# window current status style
212212+# - built-in variables are:
213213+# - #{circled_window_index}
214214+# - #{circled_session_name}
215215+# - #{hostname}
216216+# - #{hostname_ssh}
217217+# - #{hostname_full}
218218+# - #{hostname_full_ssh}
219219+# - #{username}
220220+# - #{username_ssh}
221221+tmux_conf_theme_window_status_current_fg="$tmux_conf_theme_colour_1"
222222+tmux_conf_theme_window_status_current_bg="$tmux_conf_theme_colour_4"
223223+tmux_conf_theme_window_status_current_attr="bold"
224224+tmux_conf_theme_window_status_current_format="#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}"
225225+#tmux_conf_theme_window_status_current_format="#{circled_window_index} #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}"
226226+#tmux_conf_theme_window_status_current_format="#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}"
227227+228228+# window activity status style
229229+tmux_conf_theme_window_status_activity_fg="default"
230230+tmux_conf_theme_window_status_activity_bg="default"
231231+tmux_conf_theme_window_status_activity_attr="underscore"
232232+233233+# window bell status style
234234+tmux_conf_theme_window_status_bell_fg="$tmux_conf_theme_colour_5"
235235+tmux_conf_theme_window_status_bell_bg="default"
236236+tmux_conf_theme_window_status_bell_attr="blink,bold"
237237+238238+# window last status style
239239+tmux_conf_theme_window_status_last_fg="$tmux_conf_theme_colour_4"
240240+tmux_conf_theme_window_status_last_bg="$tmux_conf_theme_colour_2"
241241+tmux_conf_theme_window_status_last_attr="none"
242242+243243+# status left/right sections separators
244244+tmux_conf_theme_left_separator_main=""
245245+tmux_conf_theme_left_separator_sub="|"
246246+tmux_conf_theme_right_separator_main=""
247247+tmux_conf_theme_right_separator_sub="|"
248248+#tmux_conf_theme_left_separator_main='\uE0B0' # /!\ you don't need to install Powerline
249249+#tmux_conf_theme_left_separator_sub='\uE0B1' # you only need fonts patched with
250250+#tmux_conf_theme_right_separator_main='\uE0B2' # Powerline symbols or the standalone
251251+#tmux_conf_theme_right_separator_sub='\uE0B3' # PowerlineSymbols.otf font, see README.md
252252+253253+# status left/right content:
254254+# - separate main sections with "|"
255255+# - separate subsections with ","
256256+# - built-in variables are:
257257+# - #{battery_bar}
258258+# - #{battery_hbar}
259259+# - #{battery_percentage}
260260+# - #{battery_status}
261261+# - #{battery_vbar}
262262+# - #{circled_session_name}
263263+# - #{hostname_ssh}
264264+# - #{hostname}
265265+# - #{hostname_full}
266266+# - #{hostname_full_ssh}
267267+# - #{loadavg}
268268+# - #{mouse}
269269+# - #{pairing}
270270+# - #{prefix}
271271+# - #{root}
272272+# - #{synchronized}
273273+# - #{uptime_y}
274274+# - #{uptime_d} (modulo 365 when #{uptime_y} is used)
275275+# - #{uptime_h}
276276+# - #{uptime_m}
277277+# - #{uptime_s}
278278+# - #{username}
279279+# - #{username_ssh}
280280+tmux_conf_theme_status_left=" ❐ #S | #{pretty_pane_current_path} "
281281+#tmux_conf_theme_status_left=" ❐ #S | ↑#{?uptime_y, #{uptime_y}y,}#{?uptime_d, #{uptime_d}d,}#{?uptime_h, #{uptime_h}h,}#{?uptime_m, #{uptime_m}m,} | #{pretty_pane_current_path} "
282282+tmux_conf_theme_status_right=" #{prefix}#{mouse}#{pairing}#{synchronized} , %R , %d %b | #{username}#{root} | #{hostname} "
283283+284284+# status left style
285285+tmux_conf_theme_status_left_fg="$tmux_conf_theme_colour_6,$tmux_conf_theme_colour_7,$tmux_conf_theme_colour_8"
286286+tmux_conf_theme_status_left_bg="$tmux_conf_theme_colour_9,$tmux_conf_theme_colour_10,$tmux_conf_theme_colour_11"
287287+tmux_conf_theme_status_left_attr="bold,none,none"
288288+289289+# status right style
290290+tmux_conf_theme_status_right_fg="$tmux_conf_theme_colour_12,$tmux_conf_theme_colour_13,$tmux_conf_theme_colour_14"
291291+tmux_conf_theme_status_right_bg="$tmux_conf_theme_colour_15,$tmux_conf_theme_colour_16,$tmux_conf_theme_colour_17"
292292+tmux_conf_theme_status_right_attr="none,none,bold"
293293+294294+# pairing indicator
295295+tmux_conf_theme_pairing="⚇" # U+2687
296296+tmux_conf_theme_pairing_fg="none"
297297+tmux_conf_theme_pairing_bg="none"
298298+tmux_conf_theme_pairing_attr="none"
299299+300300+# prefix indicator
301301+tmux_conf_theme_prefix="⌨" # U+2328
302302+tmux_conf_theme_prefix_fg="none"
303303+tmux_conf_theme_prefix_bg="none"
304304+tmux_conf_theme_prefix_attr="none"
305305+306306+# mouse indicator
307307+tmux_conf_theme_mouse="↗" # U+2197
308308+tmux_conf_theme_mouse_fg="none"
309309+tmux_conf_theme_mouse_bg="none"
310310+tmux_conf_theme_mouse_attr="none"
311311+312312+# root indicator
313313+tmux_conf_theme_root="!"
314314+tmux_conf_theme_root_fg="none"
315315+tmux_conf_theme_root_bg="none"
316316+tmux_conf_theme_root_attr="bold,blink"
317317+318318+# synchronized indicator
319319+tmux_conf_theme_synchronized="⚏" # U+268F
320320+tmux_conf_theme_synchronized_fg="none"
321321+tmux_conf_theme_synchronized_bg="none"
322322+tmux_conf_theme_synchronized_attr="none"
323323+324324+# battery bar symbols
325325+tmux_conf_battery_bar_symbol_full="◼"
326326+tmux_conf_battery_bar_symbol_empty="◻"
327327+#tmux_conf_battery_bar_symbol_full="♥"
328328+#tmux_conf_battery_bar_symbol_empty="·"
329329+330330+# battery bar length (in number of symbols), possible values are:
331331+# - auto
332332+# - a number, e.g. 5
333333+tmux_conf_battery_bar_length="auto"
334334+335335+# battery bar palette, possible values are:
336336+# - gradient (default)
337337+# - heat
338338+# - "colour_full_fg,colour_empty_fg,colour_bg"
339339+# - gradient(colour_fg_1,colour_fg_2,...,colour_fg_n)
340340+tmux_conf_battery_bar_palette="gradient"
341341+#tmux_conf_battery_bar_palette="#d70000,#e4e4e4,#000000" # red, white, black
342342+#tmux_conf_battery_bar_palette="gradient(#00afff,#47a2ff,#7c91ff,#ac7afb,#d65be2,#e163df,#eb6cdd,#f475db,#ec9ff1,#eac3fe,#efe2ff,#ffffff)"
343343+344344+# battery hbar palette, possible values are:
345345+# - gradient (default)
346346+# - heat
347347+# - "colour_low,colour_half,colour_full"
348348+# - gradient(colour_fg_1,colour_fg_2,...,colour_fg_n)
349349+tmux_conf_battery_hbar_palette="gradient"
350350+#tmux_conf_battery_hbar_palette="#d70000,#ff5f00,#5fff00" # red, orange, green
351351+#tmux_conf_battery_hbar_palette="gradient(#00afff,#47a2ff,#7c91ff,#ac7afb,#d65be2,#e163df,#eb6cdd,#f475db,#ec9ff1,#eac3fe,#efe2ff,#ffffff)"
352352+353353+# battery vbar palette, possible values are:
354354+# - gradient (default)
355355+# - heat
356356+# - "colour_low,colour_half,colour_full"
357357+# - gradient(colour_fg_1,colour_fg_2,...,colour_fg_n)
358358+tmux_conf_battery_vbar_palette="gradient"
359359+#tmux_conf_battery_vbar_palette="#d70000,#ff5f00,#5fff00" # red, orange, green
360360+#tmux_conf_battery_vbar_palette="gradient(#00afff,#47a2ff,#7c91ff,#ac7afb,#d65be2,#e163df,#eb6cdd,#f475db,#ec9ff1,#eac3fe,#efe2ff,#ffffff)"
361361+362362+# symbols used to indicate whether battery is charging or discharging
363363+tmux_conf_battery_status_charging="↑" # U+2191
364364+tmux_conf_battery_status_discharging="↓" # U+2193
365365+#tmux_conf_battery_status_charging="🔌" # U+1F50C
366366+#tmux_conf_battery_status_discharging="🔋" # U+1F50B
367367+368368+# clock style (when you hit <prefix> + t)
369369+# you may want to use %I:%M %p in place of %R in tmux_conf_theme_status_right
370370+tmux_conf_theme_clock_colour="$tmux_conf_theme_colour_4"
371371+tmux_conf_theme_clock_style="24"
372372+373373+374374+# -- clipboard -----------------------------------------------------------------
375375+376376+# in copy mode, copying selection also copies to the OS clipboard
377377+# - true
378378+# - false (default)
379379+# - disabled
380380+# on Linux, this requires xsel, xclip or wl-copy
381381+tmux_conf_copy_to_os_clipboard=false
382382+383383+384384+# -- urlscan -------------------------------------------------------------------
385385+386386+# options passed to urlscan
387387+tmux_conf_urlscan_options="--compact --dedupe"
388388+389389+390390+# -- user customizations -------------------------------------------------------
391391+392392+# this is the place to override or undo settings
393393+394394+# increase history size
395395+#set -g history-limit 10000
396396+397397+# start with mouse mode enabled
398398+#set -g mouse on
399399+400400+# force Vi mode
401401+# really you should export VISUAL or EDITOR environment variable, see manual
402402+#set -g status-keys vi
403403+#set -g mode-keys vi
404404+405405+# replace C-b by C-a instead of using both prefixes
406406+# set -gu prefix2
407407+# unbind C-a
408408+# unbind C-b
409409+# set -g prefix C-a
410410+# bind C-a send-prefix
411411+412412+# if you don't want Oh my tmux! to alter a binding or a setting, use #!important
413413+# bind c new-window -c '#{pane_current_path}' #!important
414414+415415+# move status line to top
416416+#set -g status-position top
417417+418418+419419+# -- tpm -----------------------------------------------------------------------
420420+421421+# while I don't use tpm myself, many people requested official support so here
422422+# is a seamless integration that automatically installs plugins in parallel
423423+424424+# whenever a plugin introduces a variable to be used in 'status-left' or
425425+# 'status-right', you can use it in 'tmux_conf_theme_status_left' and
426426+# 'tmux_conf_theme_status_right' variables.
427427+428428+# by default, launching tmux will update tpm and all plugins
429429+# - true (default)
430430+# - false
431431+tmux_conf_update_plugins_on_launch=true
432432+433433+# by default, reloading the configuration will update tpm and all plugins
434434+# - true (default)
435435+# - false
436436+tmux_conf_update_plugins_on_reload=true
437437+438438+# by default, reloading the configuration will uninstall tpm and plugins when no
439439+# plugins are enabled
440440+# - true (default)
441441+# - false
442442+tmux_conf_uninstall_plugins_on_reload=true
443443+444444+# /!\ the tpm bindings differ slightly from upstream:
445445+# - installing plugins: <prefix> + I
446446+# - uninstalling plugins: <prefix> + Alt + u
447447+# - updating plugins: <prefix> + u
448448+449449+# /!\ do not add set -g @plugin 'tmux-plugins/tpm'
450450+# /!\ do not add run '~/.tmux/plugins/tpm/tpm'
451451+452452+# to enable a plugin, use the 'set -g @plugin' syntax:
453453+# visit https://github.com/tmux-plugins for available plugins
454454+#set -g @plugin 'tmux-plugins/tmux-copycat'
455455+#set -g @plugin 'tmux-plugins/tmux-cpu'
456456+#set -g @plugin 'tmux-plugins/tmux-resurrect'
457457+#set -g @plugin 'tmux-plugins/tmux-continuum'
458458+#set -g @continuum-restore 'on'
459459+460460+461461+# -- custom variables ----------------------------------------------------------
462462+463463+# to define a custom #{foo} variable, define a POSIX shell function between the
464464+# '# EOF' and the '# "$@"' lines. Please note that the opening brace { character
465465+# must be on the same line as the function name otherwise the parse won't detect
466466+# it.
467467+#
468468+# then, use #{foo} in e.g. the 'tmux_conf_theme_status_left' or the
469469+# 'tmux_conf_theme_status_right' variables.
470470+471471+# ------------------------------------------------------------------------------
472472+473473+# # /!\ do not remove the following line
474474+# EOF
475475+#
476476+# # /!\ do not "uncomment" the functions: the leading "# " characters are needed
477477+#
478478+# # usage: #{weather}
479479+# weather() { # see https://github.com/chubin/wttr.in#one-line-output
480480+# curl -f -s -m 2 'wttr.in?format=3' || printf '\n' # /!\ make sure curl is installed
481481+# sleep 900 # sleep for 15 minutes, throttle network requests whatever the value of status-interval
482482+# }
483483+#
484484+# # usage: #{online}
485485+# online() {
486486+# ping -c 1 1.1.1.1 >/dev/null 2>&1 && printf '✔' || printf '✘'
487487+# }
488488+#
489489+# # usage: #{wan_ip_v4}
490490+# wan_ip_v4() {
491491+# curl -f -s -m 2 -4 ifconfig.me
492492+# sleep 300 # sleep for 5 minutes, throttle network requests whatever the value of status-interval
493493+# }
494494+#
495495+# # usage: #{wan_ip_v6}
496496+# wan_ip_v6() {
497497+# curl -f -s -m 2 -6 ifconfig.me
498498+# sleep 300 # sleep for 5 minutes, throttle network requests whatever the value of status-interval
499499+# }
500500+#
501501+# # usage: #{github_stars}, #{github_stars tmux/tmux}, ...
502502+# github_stars() {
503503+# repository=${1##*https://github.com/}
504504+# repository=${repository%% *}
505505+# repository=${repository%%.git}
506506+# url="https://api.github.com/repos/${repository:-gpakosz/.tmux}"
507507+# curl -s "$url" | perl -MJSON::PP=decode_json -CO -0777 -E '$response = decode_json(readline *STDIN); say ($response->{stargazers_count})'
508508+# sleep 300 # sleep for 5 minutes, throttle network requests whatever the value of status-interval
509509+# }
510510+#
511511+# "$@"
512512+# # /!\ do not remove the previous line
513513+# # do not write below this line
+188
.zshrc
···11+# Add deno completions to search path
22+if [[ ":$FPATH:" != *":/Users/finxol/.zsh/completions:"* ]]; then export FPATH="/Users/finxol/.zsh/completions:$FPATH"; fi
33+# If you come from bash you might have to change your $PATH.
44+# export PATH=$HOME/bin:/usr/local/bin:$PATH
55+66+# Path to your oh-my-zsh installation.
77+export ZSH="$HOME/.oh-my-zsh"
88+99+# Set name of the theme to load --- if set to "random", it will
1010+# load a random theme each time oh-my-zsh is loaded, in which case,
1111+# to know which specific one was loaded, run: echo $RANDOM_THEME
1212+# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
1313+ZSH_THEME="gallifrey"
1414+1515+# Set list of themes to pick from when loading at random
1616+# Setting this variable when ZSH_THEME=random will cause zsh to load
1717+# a theme from this variable instead of looking in $ZSH/themes/
1818+# If set to an empty array, this variable will have no effect.
1919+# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
2020+2121+# Uncomment the following line to use case-sensitive completion.
2222+# CASE_SENSITIVE="true"
2323+2424+# Uncomment the following line to use hyphen-insensitive completion.
2525+# Case-sensitive completion must be off. _ and - will be interchangeable.
2626+# HYPHEN_INSENSITIVE="true"
2727+2828+# Uncomment one of the following lines to change the auto-update behavior
2929+# zstyle ':omz:update' mode disabled # disable automatic updates
3030+# zstyle ':omz:update' mode auto # update automatically without asking
3131+# zstyle ':omz:update' mode reminder # just remind me to update when it's time
3232+3333+# Uncomment the following line to change how often to auto-update (in days).
3434+# zstyle ':omz:update' frequency 13
3535+3636+# Uncomment the following line if pasting URLs and other text is messed up.
3737+# DISABLE_MAGIC_FUNCTIONS="true"
3838+3939+# Uncomment the following line to disable colors in ls.
4040+# DISABLE_LS_COLORS="true"
4141+4242+# Uncomment the following line to disable auto-setting terminal title.
4343+# DISABLE_AUTO_TITLE="true"
4444+4545+# Uncomment the following line to enable command auto-correction.
4646+# ENABLE_CORRECTION="true"
4747+4848+# Uncomment the following line to display red dots whilst waiting for completion.
4949+# You can also set it to another string to have that shown instead of the default red dots.
5050+# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
5151+# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
5252+# COMPLETION_WAITING_DOTS="true"
5353+5454+# Uncomment the following line if you want to disable marking untracked files
5555+# under VCS as dirty. This makes repository status check for large repositories
5656+# much, much faster.
5757+# DISABLE_UNTRACKED_FILES_DIRTY="true"
5858+5959+# Uncomment the following line if you want to change the command execution time
6060+# stamp shown in the history command output.
6161+# You can set one of the optional three formats:
6262+# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
6363+# or set a custom format using the strftime function format specifications,
6464+# see 'man strftime' for details.
6565+# HIST_STAMPS="mm/dd/yyyy"
6666+6767+# Would you like to use another custom folder than $ZSH/custom?
6868+# ZSH_CUSTOM=/path/to/new-custom-folder
6969+7070+# Which plugins would you like to load?
7171+# Standard plugins can be found in $ZSH/plugins/
7272+# Custom plugins may be added to $ZSH_CUSTOM/plugins/
7373+# Example format: plugins=(rails git textmate ruby lighthouse)
7474+# Add wisely, as too many plugins slow down shell startup.
7575+plugins=(git)
7676+7777+source $ZSH/oh-my-zsh.sh
7878+7979+# User configuration
8080+8181+# export MANPATH="/usr/local/man:$MANPATH"
8282+8383+# You may need to manually set your language environment
8484+# export LANG=en_US.UTF-8
8585+8686+# Preferred editor for local and remote sessions
8787+# if [[ -n $SSH_CONNECTION ]]; then
8888+# export EDITOR='vim'
8989+# else
9090+# export EDITOR='mvim'
9191+# fi
9292+9393+# Compilation flags
9494+# export ARCHFLAGS="-arch x86_64"
9595+9696+# Set personal aliases, overriding those provided by oh-my-zsh libs,
9797+# plugins, and themes. Aliases can be placed here, though oh-my-zsh
9898+# users are encouraged to define aliases within the ZSH_CUSTOM folder.
9999+# For a full list of active aliases, run `alias`.
100100+#
101101+# Example aliases
102102+# alias zshconfig="mate ~/.zshrc"
103103+# alias ohmyzsh="mate ~/.oh-my-zsh"
104104+105105+106106+107107+108108+alias ll="eza -la --icons --group-directories-first --git"
109109+110110+export PATH="/opt/homebrew/opt/node@20/bin:$PATH"
111111+112112+113113+###############
114114+# SSH Aliases #
115115+###############
116116+117117+# Connect to VM
118118+alias ssh-vm="ssh 'finxol@fdfa:6c9d:d516:7dda:78b0:39ff:fe3d:e285'"
119119+120120+# Connect to DigitalOcean droplet
121121+alias dopers="ssh finxol@157.230.116.140"
122122+123123+# Connect to local Raspberry Pi
124124+raspi() {
125125+ ip=`curl -s https://am.i.mullvad.net/ip`
126126+127127+ if [ "$ip" = "82.67.127.125" ]; then
128128+ ssh finxol@192.168.1.158
129129+ else
130130+ echo "Not connected to home network"
131131+ echo "Please connect to Wireguard VPN"
132132+ fi
133133+}
134134+135135+###############
136136+137137+# bun completions
138138+[ -s "/Users/finxol/.bun/_bun" ] && source "/Users/finxol/.bun/_bun"
139139+140140+# bun
141141+export BUN_INSTALL="$HOME/.bun"
142142+export PATH="$BUN_INSTALL/bin:$PATH"
143143+144144+# Deno global packages
145145+export PATH="$PATH:$HOME/.deno/bin"
146146+147147+export EDITOR="vim"
148148+149149+alias c="clear -x"
150150+export PATH="/opt/homebrew/opt/node@22/bin:$PATH"
151151+152152+# pnpm
153153+export PNPM_HOME="/Users/finxol/Library/pnpm"
154154+case ":$PATH:" in
155155+ *":$PNPM_HOME:"*) ;;
156156+ *) export PATH="$PNPM_HOME:$PATH" ;;
157157+esac
158158+# pnpm end
159159+160160+# bit
161161+case ":$PATH:" in
162162+ *":/Users/finxol/bin:"*) ;;
163163+ *) export PATH="$PATH:/Users/finxol/bin" ;;
164164+esac
165165+# bit end
166166+167167+168168+eval "$(zoxide init zsh)"
169169+170170+# Automatically attach to or create tmux session named 'default'
171171+# only when running inside Ghostty and not already in tmux.
172172+if [[ -z "$TMUX" && "$TERM_PROGRAM" = "ghostty" ]]; then
173173+ exec tmux new -A -s default
174174+fi
175175+176176+# Deploy Jester's stock website
177177+deploy-stock() {
178178+ dopers "pm2 stop stock-stats && rm -rf /srv/http/stock-stats/*" && rsync -av --exclude=node_modules -e "ssh -i ~/.ssh/id_rsa" ~/Projects/dev/web/stock-stats/* finxol@157.230.116.140:/srv/http/stock-stats && dopers "cd /srv/http/stock-stats && ~/.bun/bin/bun install && ~/.bun/bin/bun run build && NODE_ENVIRONMENT=production pm2 start .output/server/index.mjs --name stock-stats"
179179+}
180180+181181+# Unquarantine app
182182+fix-app() {
183183+ xattr -d com.apple.quarantine $1
184184+}
185185+. "/Users/finxol/.deno/env"
186186+# Initialize zsh completions (added by deno install script)
187187+autoload -Uz compinit
188188+compinit
+159
setup.sh
···11+#!/bin/bash
22+33+# This script automates the initial setup and hardening of a new Debian-based server.
44+# It must be run as root.
55+#
66+# The script will:
77+# 1. Create a new sudo user.
88+# 2. Move the root SSH key to the new user.
99+# 3. Harden the SSH server configuration.
1010+# 4. Install bat, eza, and Docker.
1111+1212+# --- Configuration ---
1313+readonly USERNAME="finxol"
1414+# Define a temporary password. This will be immediately expired.
1515+# WARNING: This password will be stored in the script file and potentially
1616+# in your shell history. This is an acceptable risk for a brand new server
1717+# where the password will be changed upon first login.
1818+readonly TEMP_PASS="password"
1919+2020+# --- Script Execution ---
2121+2222+# Exit immediately if a command exits with a non-zero status.
2323+set -e
2424+# Treat unset variables as an error.
2525+set -u
2626+# Ensure that pipelines return the exit status of the last command to fail.
2727+set -o pipefail
2828+2929+# --- Helper Functions ---
3030+log() {
3131+ echo
3232+ echo "▶ $1"
3333+ echo "--------------------------------------------------"
3434+}
3535+3636+# --- Pre-flight Checks ---
3737+if [ "$(id -u)" -ne 0 ]; then
3838+ echo "This script must be run as root." >&2
3939+ exit 1
4040+fi
4141+4242+# --- User and Sudo Setup ---
4343+log "Creating user '$USERNAME' and granting sudo privileges"
4444+4545+# Create a new user without an interactive password prompt.
4646+adduser --disabled-password --gecos "" "$USERNAME"
4747+4848+# Programmatically set the temporary password for the new user.
4949+echo "$USERNAME:$TEMP_PASS" | chpasswd
5050+echo "Temporary password has been set for '$USERNAME'."
5151+5252+# Force the user to change their password on the next login.
5353+chage -d 0 "$USERNAME"
5454+5555+# Add the new user to the 'sudo' group to grant administrative privileges.
5656+usermod -aG sudo "$USERNAME"
5757+echo "User '$USERNAME' created and added to the sudo group."
5858+# --- SSH Key Migration ---
5959+log "Migrating SSH key from root to '$USERNAME'"
6060+# Create the .ssh directory for the new user if it doesn't exist.
6161+mkdir -p "/home/$USERNAME/.ssh"
6262+6363+# Move the root user's authorized_keys file to the new user's .ssh directory.
6464+mv /root/.ssh/authorized_keys "/home/$USERNAME/.ssh/authorized_keys"
6565+6666+# Set the correct ownership and permissions for the .ssh directory and its contents.
6767+chown -R "$USERNAME:$USERNAME" "/home/$USERNAME/.ssh"
6868+chmod 700 "/home/$USERNAME/.ssh"
6969+chmod 600 "/home/$USERNAME/.ssh/authorized_keys"
7070+echo "SSH key successfully migrated."
7171+7272+# --- SSH Server Hardening ---
7373+log "Hardening SSH server configuration"
7474+readonly SSHD_CONFIG="/etc/ssh/sshd_config"
7575+7676+# A function to safely set a parameter in sshd_config.
7777+# It comments out any existing instance of the key and appends the new setting.
7878+set_ssh_config() {
7979+ local key="$1"
8080+ local value="$2"
8181+8282+ # Comment out any existing lines with the key to deactivate them.
8383+ # The -E flag enables extended regular expressions for the '+' quantifier.
8484+ sed -i -E "s/^[[:space:]]*#?[[:space:]]*($key)([[:space:]]+.*)?$/#\1\2/g" "$SSHD_CONFIG"
8585+8686+ # Append the new, correct setting to the end of the file.
8787+ echo "$key $value" >> "$SSHD_CONFIG"
8888+}
8989+9090+# --- Apply Hardening Rules ---
9191+# Note: We are now using a function to ensure settings are applied correctly,
9292+# preventing issues with duplicate or conflicting rules.
9393+9494+set_ssh_config "UsePAM" "yes"
9595+set_ssh_config "PasswordAuthentication" "no"
9696+set_ssh_config "KbdInteractiveAuthentication" "no"
9797+9898+set_ssh_config "PermitRootLogin" "no"
9999+set_ssh_config "PermitEmptyPasswords" "no"
100100+set_ssh_config "X11Forwarding" "no"
101101+set_ssh_config "AllowAgentForwarding" "no"
102102+103103+# --- Custom Hardening Settings ---
104104+set_ssh_config "ClientAliveInterval" "300"
105105+set_ssh_config "ClientAliveCountMax" "2"
106106+set_ssh_config "LoginGraceTime" "60"
107107+set_ssh_config "MaxAuthTries" "3"
108108+set_ssh_config "MaxSessions" "4"
109109+110110+# Validate the new sshd_config and restart the SSH service to apply changes.
111111+sshd -t && systemctl restart sshd
112112+echo "SSH server hardened and restarted."
113113+114114+# --- Package Installation ---
115115+log "Updating package lists and installing applications"
116116+apt-get update
117117+118118+# Install bat (a cat clone with syntax highlighting)
119119+apt-get install -y bat
120120+# On Debian/Ubuntu, the binary can be named 'batcat'. Create a symlink if needed.
121121+if ! command -v bat &>/dev/null && command -v batcat &>/dev/null; then
122122+ ln -s /usr/bin/batcat /usr/bin/bat
123123+fi
124124+125125+# Install eza (a modern replacement for ls)
126126+apt-get install -y gpg
127127+mkdir -p /etc/apt/keyrings
128128+wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc |
129129+ gpg --dearmor -o /etc/apt/keyrings/gierens.gpg
130130+echo "deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main" |
131131+ tee /etc/apt/sources.list.d/gierens.list
132132+chmod 644 /etc/apt/keyrings/gierens.gpg /etc/apt/sources.list.d/gierens.list
133133+apt-get update
134134+apt-get install -y eza
135135+136136+# Install Docker Engine
137137+apt-get install -y ca-certificates curl
138138+install -m 0755 -d /etc/apt/keyrings
139139+curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
140140+chmod a+r /etc/apt/keyrings/docker.asc
141141+142142+echo \
143143+ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
144144+ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" |
145145+ tee /etc/apt/sources.list.d/docker.list >/dev/null
146146+apt-get update
147147+apt-get install -y docker-ce docker-ce-cli containerd.io \
148148+ docker-buildx-plugin docker-compose-plugin
149149+150150+# Add the new user to the 'docker' group to allow running Docker without sudo.
151151+# The '|| true' prevents the script from failing if the group already exists.
152152+groupadd docker || true
153153+usermod -aG docker "$USERNAME"
154154+echo "Docker installed and '$USERNAME' added to the docker group."
155155+156156+# --- Finalization ---
157157+log "Server setup complete!"
158158+echo "You can now log out and reconnect as '$USERNAME' using your SSH key."
159159+echo "Root login and password authentication have been disabled."