/g/ - Technology

install openbsd

[Make a Post]
[X]





/Nano/g/config なのにもうす No.8660 [D][U][F][S][L][A][C] >>8685 >>8710
File: 2a6ba7ce5f2c35f2a0a29293681906eb9793bdffad37b08e7a8a623459733d35.jpg (dl) (419.84 KiB)
This thread is supposed to be a repository for custom user-configurations.
Web browsers, operating systems, command line software, whatever else, if it has a config this is the place to share!

This is not only a thread to post your own config but also a place where to peer review other nanons configs and help others.
The purpose of using a dedicated thread instead of /Nano/g/QTDDTOT is to make it lurkable.

I will start with my own Firefox and Tor Browser user.js configuration when i finish reviewing it.

Nanonymous No.8670 [D] >>8685
Do not change web browser config, it will make it have unique fingerprint

Install Tor Browser, set it to Highest security slider. if you want to harden it against exploits, use virtual machine / isolation / firewall / etc

Nanonymous No.8685 [D] >>8708 >>9063 >>10252
>>8660
data mining thread do not reply
>>8670
>oy vey goy, use our (((predefined settings))) goy. don't change it! y-you'll have a fingerprint goy!
Kys mordecai

Nanonymous No.8693 [D][U][F]
File: a963a121bfc226d908b4a0a696fd93b8a855cbf3609866bee59007052bda5476.jpg (dl) (179.53 KiB)
~/.inputrc
"\e/": "cd .. && tput cuu1 && tput el\n"
"\ek": "cd $OLDPWD && tput cuu1 && tput el\n"
"\eh": "cd $HOME && tput cuu1 && tput el\n"

─────

cd'ing into frequently used directories without typing "cd" for readline-aware shells.

Nanonymous No.8708 [D]
>>8685
neck yourself now

Nanonymous No.8710 [D][U][F] >>9321
File: d1578ddd86e25cefbfaa8b32fd09b1f8eabd938d5713c46c82360224a2a47d4a.jpg (dl) (24.69 KiB)
>>8660
Thanks for making me look in my own dotfiles, found those gems in bashrc

alias gestapo="ss -tul"
alias fucking=sudo

Nanonymous No.8910 [D]
To have emacs cut/paste in zsh (well, fc is here for simple shells).


[ ${key[Ctrl+Left]} ] && bindkey "${key[Ctrl+Left]}" emacs-backward-word
[ ${key[Ctrl+Right]} ] && bindkey "${key[Ctrl+Right]}" emacs-forward-word

my-kill-region()
{
[ $REGION_ACTIVE -eq 0 ] && zle backward-kill-word || zle kill-region
}
zle -N my-kill-region

bindkey -e '^W' my-kill-region

Nanonymous No.9025 [D][U][F] >>9026 >>9027 >>9322
File: 4cbc1fffc35d81f6b24e04ec9e0144e62ca7cd39e4a68fe3fa65871c32598e47.gif (dl) (1.35 MiB)
I keep all of my links and contact stuff in text files that I cat stuff to with a comment to find. I started doing this when I got tired of importing a bunch of config files and was paranoid my browser might leak my bookmarks so I just do this.

_
#/bin/bash
echo "grep "
read input
grep $input /path/to/commonly/grepped/file

_

alias thatfileialwaysgrep='thatgrepscript.sh'

Nanonymous No.9026 [D] >>9479
>>9025
>#/bin/bash
You aren't using any bash-only syntax, change it to #!/bin/sh
>echo "grep "
>read input
Read https://www.etalabs.net/sh_tricks.html
tl;dr printf > echo, use read -r
>grep $input /path/to/commonly/grepped/file
Always quote variables.

Nanonymous No.9027 [D]
>>9025
this is fucking cancer
do you hate using positional parameters ($1 $2 and so on) or are you simply not aware of those?
also quoting variables is some good advice, but i guess not in your particular case

Nanonymous No.9041 [D] >>9056 >>9083
You should not assume where sh lives. Change it to
#!/usr/bin/env sh

Nanonymous No.9054 [D]
[code]testing if nanochan supports it[/code]

Nanonymous No.9055 [D] >>9085
A friend of mine wrote this for me. I use it for encoding, only changing the bitrate depending on my needs.
The encoding time is not too long and the result is great.
The way it works, you put it in a folder with a video file(can't have any spaces) and then open a terminal on the folder and type "python3 (the filename.py os the script here). It will proceed to encode all files in the folder.

#!/usr/bin/env python3
import os
from os.path import isfile

files = os.listdir('./')
exts = ['mp4', 'mkv', 'avi', 'webm', 'flv']

for file in files:
if isfile(file):
ext = file.split('.')[-1]
if ext in exts:
print('Processing -> "%s"' % file)
try:
#Parametros
entrada = file
saida = '%s_vp9.webm' % file.split('.')[0]
ass = '%s.ass' % file.split('.')[0]
#Encode
os.system('ffmpeg -i %s -c:v libvpx-vp9 -b:v 600K -pass 1 -an -f webm /dev/null -y' % entrada)
os.system('ffmpeg -i %s -c:v libvpx-vp9 -b:v 600K -pass 2 -strict experimental -c:a libopus -b:a 48k -sn %s -y' % (entrada, saida))
except Exception as E:
print('Error processing "%s"\n%s' % (file, E))

Nanonymous No.9056 [D]
>>9041
>You should not assume where sh lives.
You should not assume where env lives.
Name an OS that has /usr/bin/env but doesn't have /bin/sh.
Protip: You can't.
In fact, I doubt you can find a UNIX-like OS that doesn't have /bin/sh in the first place.

Nanonymous No.9063 [D]
>>8685
>oy vey goy, use your (((unique settings))) goy. change everything! y-you'll have super security and privacy goy!

Nanonymous No.9079 [D][U][F]
File: d471fd86705b300f79c3d16933b94514fd86c3cc8b9997e927824a88b6d0528c.jpg (dl) (127.07 KiB)
alias rot13="tr 'A-Za-z' 'N-ZA-Mn-za-m'"
alias rot47="tr '\!-~' 'P-~\!-O'"

Attached are my ffmpeg presets for encoding vp9.
https://0x0.st/zgM3.bz2
/ipfs/QmbvMJxqPegcWqc9kCDmnSC5BGy5nJQ14ZWYjfWt4EpdK3

Nanonymous No.9083 [D]
>>9041
any linux distribution or bsd that doesn't keep at least a working /bin/sh symlink is garbage. Also, from the perspective of a humble user, I think KISS principle trumps portability every time.

Nanonymous No.9084 [D] >>9085 >>9323 >>9447
I know you didn't write this but maybe someone else can answer.
Why the fuck does everyone write python scripts where you're literally just going to do "os.system(the thing)" every time your script does something?! Why not just write a bash script, bash isn't posix compliant so you have arrays and a bunch of other shit to use why would you write this in python?

Nanonymous No.9085 [D]
>>9084 meant for >>9055

Nanonymous No.9321 [D]
>>8710
> alias gestapo="ss -tul"
Do you have "kill -1" aliased to "sigheil"?

Nanonymous No.9322 [D]
>>9025
>#/bin/bash
Missing the ! of #!/bin/bash would mean the subsequent commands are not run in a separate shell, because "!" is part of the magic number "#!" - is it not so??

Re-writing what you have so you can include everything in the one file (the contact stuff you want to grep is included at the bottom of the script):
$ cat fooscript.sh

#!/bin/bash
if [ $# -eq 0 ]; then
echo "Enter some search terms."
exit
fi
grep -- "${@}" "${0}"
exit
#commonly grepped text file included below
...
...
...
#end of commonly grepped text file



You can obviously leave out the "--" part after grep if you do want to pass extra parameters to grep as the initial arguments of your script.

>alias thatfileialwaysgrep='thatgrepscript.sh'
Why not make your a ~/bin directory, put your scripts in that, and then add the directory to your .bashrc $PATH value?
That way you can keep your scripts organized and easily invoke them without worrying if you made an alias for it or not.

Nanonymous No.9323 [D] >>9324
>#!/usr/bin/env python3
>import os
>from os.path import isfile
>
>files = os.listdir('./')
>exts = ['mp4', 'mkv', 'avi', 'webm', 'flv']
>
>for file in files:
> if isfile(file):
> ext = file.split('.')[-1]
> if ext in exts:
> print('Processing -> "%s"' % file)
> try:
> #Parametros
> entrada = file
> saida = '%s_vp9.webm' % file.split('.')[0]
> ass = '%s.ass' % file.split('.')[0]
> #Encode
> os.system('ffmpeg -i %s -c:v libvpx-vp9 -b:v 600K -pass 1 -an -f webm /dev/null -y' % entrada)
> os.system('ffmpeg -i %s -c:v libvpx-vp9 -b:v 600K -pass 2 -strict experimental -c:a libopus -b:a 48k -sn %s -y' % (entrada, saida))
> except Exception as E:
> print('Error processing "%s"\n%s' % (file, E))
>
>
One line equivalent bash 'script'...

for i in {*.mp4,*.mkv,*.avi,*.webm,*.flv}; do echo "Processing ${i}"; ffmpeg -y -hide_banner -i "${i}" -c:v libvpx-vp9 -b:v 600K -pass 1 -an -f webm /dev/null && ffmpeg -hide_banner -i "${i}" -c:v libvpx-vp9 -b:v 600K -pass 2 -strict experimental -c:a libopus -b:a 48k -sn "${i}" -y "${i%.*}_vp9.webm" ;done

>>9084
>why would you write this in python?
I have no idea, but it seems a remarkably fashionable thing to do.


Nanonymous No.9324 [D]
>>9323
>equivalent
I missed the addition of || echo "Error processing ${i}" but you can add that along with $1 for bit rate values if you wish.

Nanonymous No.9447 [D]
>>9084
The one that takes the cake though was asukafag's bash script that pipes python code into the interpreter for it's os.random or whatever it's called function, still gives me a good laugh when I think about it

Nanonymous No.9450 [D] >>9468
OpenSSH uses NSA-produced curves for encryption nowadays. You can disable it with this line:
[code]KexAlgorithms -*nistp*[/code]
Add it to both ssh_config and sshd_config so it applies to both your client and server.

SSH also still allows sha1 in the KexAlgorithms by default, aswell as 1024 bit DSA.
For MACs the situation is about the same. md5 of all things, sha1, and even umac with only 64 and 96 bits as algorithms in the "MACs" option are the default. As such I recommend you actually put this in your config file:
[code]KexAlgorithms -*sha1*,*nistp*,*group14*
MACs -*md5*,*sha1*,*64*,*96*[/code]



Nanonymous No.9468 [D] >>10256
>>9450
I dropped my spaghetti hard and the information was not nearly enough.

Try this for sshd_config:
CASignatureAlgorithms -*nistp*
HostBasedAcceptedKeyTypes -*nistp*
HostKeyAlgorithms -*nistp*
KexAlgorithms -*sha1*,*nistp*,*group14*
PubkeyAcceptedKeyTypes -*nistp*
MACs -*md5*,*sha1*,*64*,*96*



And this for ssh_config:
CASignatureAlgorithms -*nistp*
HostbasedKeyTypes -*nistp*
HostKeyAlgorithms -*nistp*
KexAlgorithms -*sha1*,*nistp*,*group14*
PubkeyAcceptedKeyTypes -*nistp*
MACs -*md5*,*sha1*,*64*,*96*

Nanonymous No.9479 [D] >>9484 >>9489
>>9026
Different nanon. Thanks for the link. I never learned proper scripting syntax, so none of my scripts comply with POSIX.

Nanonymous No.9484 [D]
>>9479
man sh

Nanonymous No.9489 [D] >>9490
>>9479
I think most people just use whatever they first stumble on the Internet, so they never really learn shell scripting, although I'll admit that sometimes it can be a pain to write POSIX-compliant shell scripts.

You can use the shellcheck toghether with a #!/bin/sh shebang or checkbashisms to check your scripts.

Nanonymous No.9490 [D] >>9512
>>9489
Forgot to add that you usually want to add set -u (Exists if variable is undefined) at the top of your scripts and maybe set -e (Exists if command returns non-zero exit status).

Nanonymous No.9512 [D] >>9513
>>9490
s/Exists/exits/g

Nanonymous No.9513 [D]
>>9512
Somehow, I fucked up twice.

Nanonymous No.9555 [D][U][F]
File: fb88ec5f23fe93881cdc672c32a90ecfd13d4b7a64d3914419a513bc07c6d9b9.jpg (dl) (20.22 KiB)
alias xargs="xargs -I{} -d'\n' -P$(nproc) stdbuf -o1M "

Basic parallel functionality but with xargs. What this ultimately means is that since you're running mostly machine code instead of a perl script, it's much faster, which is specially useful when you use parallel to spawn tasks really fast.
It also doesn't require parallel, and is POSIX-compliant if you take out the stdbuf and $(nproc) parts.

Nanonymous No.9868 [D][U][F] >>10286
File: 06d9cdf89852c122a6540168f2c76af5b705fbbb586e065e1dedf5587ee92bb2.jpg (dl) (622.21 KiB)
Hey, since this thread has a load of shell scripting I figure it's the perfect place to publish my file upload script.
I've been working on it for a few hours a day these past 3 or so days as a study exercise, aswell as obviously the utility of such a script.

https://anonfile.com/7bj8L9C4nd
https://anonfiles.com/B0j8L2Cbne
https://bayfiles.com/D5j3L1C3n5
https://files.catbox.moe/ub16zx.gz
https://letsupload.cc/N8jbLbCfn0
https://megaupload.is/T8jdL1C0n9
https://myfile.is/X6jfLbC8n7
https://openload.cc/dfkbLeCbn0
https://share-online.is/fck4LaCbn7
https://a.uguu.se/YRmYP8y48luG_upload.gz
https://upl.io/2o6wfz
https://x0.at/DN6.gz
https://www11.zippyshare.com/v/wKB1CP9y/file.html


Any criticism is welcome. And yes I generated all of these links using the script.

Nanonymous No.10250 [D] >>10253
Anyone who can help me make my script workable?
i have my "bookmarks" in ~/.onion.txt in the format

site = url.onion

[code]
#!/bin/bash
# Add the url to the $url parameter
url = grep $1 ~/.onion.txt
# Remove anything before =
sed blablabla

torify w3m $url
[/code]

Nanonymous No.10252 [D][U][F] >>10256
File: 080692f7c40160fec4f59c7257281dd0af457b8cfb7c36b9e2288f14838b53a2.gif (dl) (3.20 MiB)
>>8685
It`s hard to take anything in this thread seriously when a Nanon`s only argument is (((Jews))) or "data mining thread," and no actual technical explanation on the subject matter at hand.

inb4
>Okay Mossad
>(((Jew)))
>Oy vey

Am super Far Right. Thank you to the Nanons that did contribute, you`re appreciated!

Nanonymous No.10253 [D] >>10255
>>10250
one-liner:
function_name() {
torify w3m "$(grep "$1" "$HOME/.onion.txt" | awk 'NR==1{print $NF}')"
}

Nanonymous No.10254 [D]
#!/bin/bash
#Script to make sure tor is working

ip="$(curl -s ifconfig.me)"
torip="$(torify curl -s ifconfig.me)"

echo ""
echo Kikes gassed so far: ${ip}
echo ""
echo "Gassing Kikes"
echo ""
echo Kikes left to gas: ${torip}
echo ""

Nanonymous No.10255 [D]
>>10253
Thanks anon

Nanonymous No.10256 [D][U][F]
File: 59bae8c8723b5376ce6bbb76d606028dd7401e17cfaf80b2bc028befc3bcee96.jpg (dl) (41.24 KiB)
>>10252
It's hard to take any "Here's my script, cut and paste into CLI" thread seriously. You should never do that at all.

>>9468
>Hey guyz, do the exact opposite of what I'm describing and enable all these suspect options.

The /pol tards aren't completely off track, other than that Jews aren't the only ones that do it.

Nanonymous No.10286 [D]
>>9868 why not use and abuse gpg encrypted files placed on termbin? I reckon it even lets you upload files through tor. Everyone should public their private key use a work e-mail with a pgp signature, forcing normal-cattle to either accept it (and install enigmail plugin) or say fuck it and drop this medium entirely. It still puzzles me how come normal cattle so much "worried" about their privacy and secrecy carry their nigger-phones on them with always-on banking and other shit can't fathom that their e-mail passwords are easily breakable and all their private unencrypted info ought to be leaked.

Contributing to the thread. Downsample those 200MB pdfs. Ghostscript is required.
# pdfresize - downgrade pdf quality to 150 dpi
function pdfresize() {
INPUT=$1; OUTPUT=$2;
[ -z "$3" ] && QUALITY=ebook;
[ ! -z "$3" ] && QUALITY=$3;
ghostscript -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \
-dCompatibilityLevel=1.4 -dPDFSETTINGS=/${QUALITY} \
-sOutputFile=${OUTPUT} ${INPUT}
}