1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
|
# Wiki
## Introduction
This is a living document that will expand alongside my own personal experiences and knowledge. Topics range from device settings, computer configurations, household product serial numbers / expiry dates, and so on. Hopefully this can end up being helpful to others as well.
## Open Suck
My personal, lightweight desktop installer for OpenBSD based on the suckless philosophy. Includes my own custom set of suckless tools (dwm, slstatus, dmenu, etc.)
- [https://git.sr.ht/~bt/open-suck](https://git.sr.ht/~bt/open-suck)
## vimrc
```
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
" For plugins to load correctly
filetype plugin indent on
" TODO: Pick a leader key
" let mapleader = ","
" Security
set modelines=0
" Show line numbers
set number
" Show file stats
set ruler
" Blink cursor on error instead of beeping (grr)
set visualbell
" Encoding
set encoding=utf-8
" Whitespace
set wrap
set textwidth=79
set formatoptions=tcqrn1
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set noshiftround
" Cursor motion
set scrolloff=3
set backspace=indent,eol,start
set matchpairs+=<:> " use % to jump between pairs
runtime! macros/matchit.vim
" Move up/down editor lines
nnoremap j gj
nnoremap k gk
" Allow hidden buffers
set hidden
" Rendering
set ttyfast
" Status bar
set laststatus=2
" Last line
set showmode
set showcmd
" Searching
nnoremap / /\v
vnoremap / /\v
set hlsearch
set incsearch
set ignorecase
set smartcase
set showmatch
map <leader><space> :let @/=''<cr> " clear search
" Remap help key.
inoremap <F1> <ESC>:set invfullscreen<CR>a
nnoremap <F1> :set invfullscreen<CR>
vnoremap <F1> :set invfullscreen<CR>
" Textmate holdouts
" Formatting
map <leader>q gqip
" Visualize tabs and newlines
set listchars=tab:▸\ ,eol:¬
" Uncomment this to enable by default:
" set list " To enable by default
" Or use your leader key + l to toggle on/off
map <leader>l :set list!<CR> " Toggle tabs and EOL
" Color scheme (terminal)
set t_Co=256
set background=dark
let g:solarized_termcolors=256
let g:solarized_termtrans=1
" put https://raw.github.com/altercation/vim-colors-solarized/master/colors/solarized.vim
" in ~/.vim/colors/ and uncomment:
" colorscheme solarized
```
## .zshrc extras / aliases
```
export EDITOR="/bin/vim"
alias suck="sudo rm -rf config.h ; sudo make install"
alias fixmonitor="xrandr --auto --output eDP1 --mode 1366x768 --below DP2-2"
alias vscode="alias vscode="ENABLE_WASM=1 chrome --enable-wasm --disable-unveil""
```
## mimeapps.list
Place this file under `/usr/share/applications/mimeapps.list`
```
[Default Applications]
x-scheme-handler/http=org.qutebrowser.qutebrowser.desktop
x-scheme-handler/https=org.qutebrowser.qutebrowser.desktop
x-scheme-handler/ftp=org.qutebrowser.qutebrowser.desktop
x-scheme-handler/chrome=org.qutebrowser.qutebrowser.desktop
text/html=org.qutebrowser.qutebrowser.desktop
application/x-extension-htm=org.qutebrowser.qutebrowser.desktop
application/x-extension-html=org.qutebrowser.qutebrowser.desktop
application/x-extension-shtml=org.qutebrowser.qutebrowser.desktop
application/xhtml+xml=org.qutebrowser.qutebrowser.desktop
application/x-extension-xhtml=org.qutebrowser.qutebrowser.desktop
application/x-extension-xht=org.qutebrowser.qutebrowser.desktop
image/jpeg=feh
image/png=feh
image/webp=feh
```
## qutebrowser
### Greasemonkey
All of these scripts should be added under `~/.local/share/qutebrowser/greasemonkey/`. Then be sure to run the proper command within qutebrowser: `:greasemonkey-reload`
#### Auto Skip YouTube Ads
```
// ==UserScript==
// @name Auto Skip YouTube Ads
// @version 1.0.0
// @description Speed up and skip YouTube ads automatically
// @author jso8910
// @match *://*.youtube.com/*
// @exclude *://*.youtube.com/subscribe_embed?*
// ==/UserScript==
setInterval(() => {
const btn = document.querySelector('.videoAdUiSkipButton,.ytp-ad-skip-button')
if (btn) {
btn.click()
}
const ad = [...document.querySelectorAll('.ad-showing')][0];
if (ad) {
document.querySelector('video').playbackRate = 10;
}
}, 50)
```
## `ffmpeg` to MP4
```
ffmpeg -i input_filename.avi -c:v copy -c:a copy -y output_filename.mp4
```
## Mount USB HDD via CLI
```
mkdir /media/usb-drive
mount /dev/sdX /media/usb-drive/
```
## Run Mullvad on Alpine Linux (Wireguard)
```
# Install wireguard
apk add wireguard-tools
```
Login into Mullvad and download the proper wireguard configuration files(s). After downloaded, place in the proper directory:
```
doas cp <MULLVAD_FILENAME>.conf /etc/wireguard/"
```
Then setup an aliases for easier up/down states:
```
alias vpnup="doas wg-quick up /etc/wireguard/<MULLVAD_FILENAME>.conf"
alias vpndown="doas wg-quick down /etc/wireguard/<MULLVAD_FILENAME>.conf"
```
## Alpine Linux `mini_racer` Tweaks
Gem lockfile:
```
PLATFORMS
ruby
x86_64-linux-musl
mini_racer (0.6.3)
<remove child dependency>
```
then run: `bundle update mini_racer`
## Docker
Installing `ghost`
```
docker pull ghost
```
```
docker run -d \
--name ghost-name \
-e NODE_ENV=development \
-p 2368:2368 \
-v $HOME/path/to/ghost/blog:/var/lib/ghost/content \
ghost:alpine
```
## MongoDB 3.4 on Ubuntu 23.10
```
wget http://launchpadlibrarian.net/668089858/libssl1.0.0_1.0.2n-1ubuntu5.13_amd64.deb
sudo apt install ./libssl1.0.0_1.0.2n-1ubuntu5.13_amd64.deb
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
```
Now edit `/etc/apt/sources.list.d/mongodb-org-3.4.list`:
```
deb [trusted=yes] http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.4...
```
Then finish things up:
```
sudo apt-get update --allow-unauthenticated
sudo apt-get install -y mongodb-org
sudo mkdir -p /data/db
sudo chmod -R 777 /data/db
```
## Redis 6.0.7 on Ubuntu 23.10
```
sudo apt-get install build-essential tcl
cd /tmp
curl -O http://download.redis.io/releases/redis-6.0.7.tar.gz
tar xzvf redis-6.0.7.tar.gz
cd redis-6.0.7
```
Install redis:
```
make
make test
sudo make install
sudo mkdir /etc/redis
sudo cp /tmp/redis-6.0.7redis.conf /etc/redis
```
Edit `/etc/redis/redis.conf` with the following changes:
- `supervised systemd`
- `dir /var/lib/redis`
Create systemd unit file for redis: `/etc/systemd/system/redis.service`:
```
[Unit]
Description=Redis In-Memory Data Store
After=network.target
[Service]
User=redis
Group=redis
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=always
[Install]
WantedBy=multi-user.target
```
Final steps:
```
sudo adduser --system --group --no-create-home redis
sudo mkdir /var/lib/redis
sudo chown redis:redis /var/lib/redis
sudo chmod 770 /var/lib/redis
```
## Ruby 2.7.2 with rbenv on Ubuntu 23.10
Edit the `/etc/apt/sources.list` file:
```
deb [trusted=yes] http://security.ubuntu.com/ubuntu bionic-security main
```
Then run `sudo apt-get update`. After completion, install `libssl1.0-dev`:
```
sudo apt-get install libssl1.0-dev
```
## Fix screen tearing
```
sudo micro /etc/X11/xorg.conf.d/20-intel.conf
```
Add the following contents to `20-intel.conf`:
```
Section "OutputClass"
Identifier "Intel Graphics"
MatchDriver "i915"
Driver "intel"
Option "DRI" "3"
Option "TearFree" "1"
EndSection
```
## Enabling "tap to click"
```
sudo micro /etc/X11/xorg.conf.d/30-touchpad.conf
```
Add the following contents to `30-touchpad.conf`:
Section "InputClass"
Identifier "touchpad"
Driver "libinput"
MatchIsTouchpad "on"
Option "Tapping" "on"
Option "TappingButtonMap" "lmr"
EndSection
## Woocommerce
**Reset all product menu_order to `0`**
```
UPDATE wp_posts SET menu_order = 0 WHERE post_type = 'product';
```
|