The Free Wiki

Hello World!


Project maintained by Soimuen11

Table Of Contents

Mounting Android Phones In Linux

  1. Install simple-mtpfs (from the AUR if you are running Arch Linux)
  2. Create Android/ directory in your home/
  3. Run : simple-mtpfs -o enable-move –device 1 Android/ (1 being the device ID)
  4. Unmount with : fusermount -u Android/

Other solutions to transfer files:

Installing Android in Vbox

Curl

Get Your IP Address

curl ifconfig.co
curl ifconfig.co/city
curl ifconfig.co/country

# You may also do these commands:
ip a
ifconfig
hostname -I

News

curl getnews.tech

Weather

curl wttr.in

Video / Audio Editing Software

Converting markdown to pdf

You may install pandoc, but since I do not need all its power, I have chosen to install a much smaller npm package:

npm install -g markdown-pdf
markdown-pdf <markdown-file-path>

Displaying keystrokes during screencast

Install Screenkey, obviously with root priviledges.

Easily Styling Termite Terminal

Termite is a terminal emulator which I would most definitely recommend. To configure colors and fonts quickly and nicely, I recommend this program which you can find on github:

For Arch users, I believe it is also directly available in the AUR (it was when I wrote this section). When I last edited this section (on Aug 13, 2021), I read that termite is now obsolete. Hence it might be wiser to make the switch to alacritty, as the maintainer of the git repo indicated.

Downloading Videos From YouTube

One program to rule them all:

I have never fully experienced it but some people have recommended it to me:

Concatenating Pdfs

yay -S pdf-append #for Arch users

Regular Expressions Basics

A Chaotic List Of Useful Programs

Networking

nmtui # Configure & connect to a network with ncurses interface
nmcli # Cli equivalent to nmtui
sudo pacman -S networkmanager # To install it on Arch Linux
sudo apt install network-manager # To install it on Ubuntu
nmap -A -T4 hostname # See which devices are connected to your network
wireshark # monitor a network
nslookup
wifite2
ifconfig
ip a
net-setup #to set up connection from the Gentoo livecd.

Create Your Own Wiki

Monitor Your System

Partition Disk

fdisk
sfdisk # From a bash script (to automate disk partitioning)
cfdisk # More readable output than fdisk

Edit Subtitles

Pentesting programs & websites

Analyzing

Password Attacks

Sniffing

Other

Xorg Programs

Write On Screen

Formatting A Flashdrive

Removing Sensitive Data From Git Repo

Great LS commands

lsusb #list usb devices
lscpu #display information about cpu architecture
lspci #list all pci devices
lsblk #list block devices

Some vim tricks

Copying text from vim to an external program

"+y

Vim r!

Write the result of the ls command in a file directly from vim

:r! ls 

Create TOCs For Markdown Files

Use this vim plugin to automatically generate a table of contents for your markdown file:

Main commands:

  1. :GenTocGFM Generate table of contents in GFM link style. This command is suitable for Markdown files in GitHub repositories, like README.md, and Markdown files for GitBook.

  2. :GenTocRedcarpet Generate table of contents in Redcarpet link style. This command is suitable for Jekyll or anywhere else use Redcarpet as its Markdown parser.

  3. :GenTocGitLab Generate table of contents in GitLab link style. This command is suitable for GitLab repository and wiki.

  4. :GenTocMarked Generate table of contents for iamcco/markdown-preview.vim which use Marked markdown parser.

Vim powerline

VIFM Matrix Color Scheme

.config/vifm/colors/Default.vifm

" Matrix
" by Michael jubalh Vetter
" https://github.com/jubalh/vifm-colors

highlight clear

highlight Win             cterm=none ctermfg=green    ctermbg=black

highlight TopLine         cterm=none ctermfg=green       ctermbg=none
highlight TopLineSel      cterm=none ctermfg=green       ctermbg=none
highlight StatusLine      cterm=none ctermfg=green       ctermbg=none
highlight Border          cterm=none ctermfg=green       ctermbg=none

highlight Selected        cterm=bold ctermfg=red    ctermbg=default
highlight CurrLine        cterm=bold ctermfg=black    ctermbg=green

highlight WildMenu        cterm=underline,reverse ctermfg=white ctermbg=black
highlight CmdLine         cterm=none ctermfg=white ctermbg=black
highlight ErrorMsg        cterm=none ctermfg=red ctermbg=black

highlight Directory       cterm=none ctermfg=blue ctermbg=default
highlight Link            cterm=none ctermfg=yellow ctermbg=default
highlight BrokenLink      cterm=none ctermfg=red ctermbg=default
highlight Socket          cterm=none ctermfg=yellow ctermbg=default
highlight Device          cterm=none ctermfg=yellow ctermbg=default
highlight Fifo            cterm=none ctermfg=yellow ctermbg=default
highlight Executable      cterm=none ctermfg=green ctermbg=default

Fuzzy Finders

Modifying images

Patching Suckless Software

  1. clone the repository of the program you want to patch (eg: dmenu) in .local/repos/
  2. cd into the repo && run : sudo make install
  3. download the patches
  4. run : patch -p1 < name-of-patch.diff
  5. if something goes wrong, look into the patch file and modify your source files manually (config.h for dmenu and dwm)

NB : YOU NEED TO RECOMPILE (SUDO MAKE INSTALL) EVERY TIME YOU MAKE AN EDIT !

Configuring Neomutt

If you wish to go through the whole process, here is what I recommend:

  1. Install offlineimap msmtp, notmuch & neomutt
  2. Begin configuring offlineimap (first get one account to work, then several if necessary)
  3. When done with offlineimap, configure msmtp for one account. If all goes well, do it for several.
  4. Link your offlineimap config to neomutt. If you do not know how, the arch wiki explains it really well on its page regarding offlineimap.
  5. Do the same for your msmtp config.
  6. Run “notmuch”, a script will run through the config with you.
  7. Congrats, you may now consult and send your emails from neomutt.
  8. Set up a cron job to regularly sync your email (offlineimap + notmuch new)
  9. Useful programs to combine with neomutt
  10. A great article explaining how set up everything

Optional step: Install pass to make your password management more secure.

Hdparm

hdparm is a command line utility to set and view hardware parameters of hard disk drives. It can also be used as a simple benchmarking tool:

Streaming With CVLC Command Line Mode

Open your terminal & run:

vlc v4l2:// :v4l-vdev="/dev/video0" OR mpv /dev/video0

Then start the video with :

ffmpeg -video_size 1366x768 -framerate 25 -f x11grab -i :0.0 -f pulse -ac 2 -i 1 output.mkv -async 1 -vsync 1

Audio Management

Linux Distros

Ones You Should Be Curious About

NB: source-based = you need to compile your programs when installing them = you do not directly install binaries

Mother distros

  1. Slackware
  2. Debian (comes with binaries)
  3. Ubuntu (debian-based)
  4. Sorcerer (source-based)
  5. Crux (Arch’s big daddy)
  6. Gentoo / Enoch
  7. Redhat (Fedora, CentOS, others)

Iptables Firewall Rules

A firewall is essentially a way to filter traffic. What traffic do you want to allow / block ?

There are 3 different ways that data can be sent:

In between brackets, you have the POLICY, which ACCEPTs everything by default.

Some useful Commands:

iptables -L #(or --list) List  current firewall rules
iptables -P POLICY DROP/ACCEPT #Change a (-P) policy from drop to accept, or vice versa.

# example: 
iptables -P FORWARD DROP

# If your computer is not set up as a router, you don't need FORWARD to accept
# everything, so you can set its policty to DROP.

iptables -A #Add or Append a rule to the bottom of the chain
iptables -I #Add or Append a rule to the top of the chain

#Make rules permanent:
sudo iptables-save > /etc/iptables/iptables.rules

If you wish to quickly and easily set up your firewall, you may use Chris Titus’ configuration, which you can find clicking on the link below:

Ranger (File Manager Program)

Rename several files in one go : select the files you wish to rename with the space bar. Then type :bulkrename. That will open your fave text-editor and then you can rename them as you wish.

dmesg

Program to control or examine the kernel ring buffer.

systemd-analyze

Analyze how much time it takes for each service to load (how long to completely boot your pc)

systemd-analyze
systemd-analyze critical-chain graphical.target
systemd-analyze blame

Managing logs

last #shows a listing of last logged in users

Pacman

Pacman is the main package manager for arch-based systems.

pacman -S # Install a program
pacman -Ss # Search for a program
pacman -Syu # Update + upgrade the system
pacman -Syyuu 
pacman -Q
pacman -Qte
pacman -R OR pacman -Rns # This removes a program and all its dependencies / config files
pacman -Rdd $ program # This removes only the program without its dependencies
pacman -Rc $program # This removes all the packages which depend on a program

Software To Make Your Own Music

Nice Ncurses Programs

Recovering deleted files

Spreadsheet Program With Vim Bindings

Display Manager Setup

  1. Permanently change DM:
     sudo systemctl disable [$CURRENT-DISPLAY-MANAGER]
     sudo systemctl enable [$NEW-DISPLAY-MANAGER]
    
  2. Temporarily change DM:
     sudo systemctl stop [$CURRENT-DISPLAY-MANAGER]
     sudo systemctl start [$NEW-DISPLAY-MANAGER]
    
  3. Restart DM:
    sudo systemctl restart [$DISLAY-MANAGER-NAME]
    

Set Keyboard With Setxkbmap

Forever Option 1:

  1. Create a file : /etc/X11/xorg.conf.d/10-keyboard.conf
  2. Add lines I added in my current 10-keyboard.conf

Temporarily:

If you wish to remap your capslock and make it behave like the control key, you may also add this line to your .xprofile:

setxkbmap -option ctrl:nocaps

Bc

Bc is a built-in POSIX CLI calculator (for bash).

Autojump

Browser Recommendations

  1. Iridium is the best one regarding privacy
  2. Brave & vimium plugin: for its relative security builtin js/ad-blocker & its speed
  3. Qutebrowser: if you love vim, you will love it
  4. Firefox with the pentadactyl plugin

FROM WEBSITES:

FROM YOUTUBE CHANNEL:

INSTALL NEWSBOAT:

Gaming On Linux

False Stereotypes:

Nothing is less true than “you cannot play on Linux”. Try out these one of these 3 programs and you will not be disappointed. I highly recommend Steam. It has entertained me for many an hour.

All these programs are well documented in the Arch Wiki. Be careful and install the proper fonts/dependencies for Steam! All three programs are directly available with pacman or in the AUR.

Emulating console games:

Many emulators exist. Here are the ones I use and consider as “the best”:

  1. Nintendo DS (nds): desmume
  2. GameBoy Advanced (gba): vbam
  3. PlayStation Portable (psp): ppsspp
  4. Wii-U: decaf OR Cemu & Wine
  5. PC: Wine + Playonlinux
  6. Wii + Gamecube: Dolphin
  7. Nintendo 64: Mupen64plus

Downloading roms:

Free & OpenSource Games

Jekyll Tutorial

One-Page Static Website On Github

  1. Create a new repo with a readme.
  2. Add content to the readme.
  3. Go to Settings > Pages.
  4. Choose the main branch & a theme.
  5. Save. You only need wait a few seconds/minutes and your website should be published.

A More Customized Site

Install dependencies: + Ruby (version 2.5 or higher) + Rubygems + Gcc and make

sudo apt install ruby-full build-essential zlib1g-dev

Install bundler & jekyll:

gem install bundler jekyll

Create a new Jekyll project:

jekyll new $PROJECT-NAME

Initialize a Gemfile:

bundler init

Go to the rubygems website:

Add name of your theme to _config.yml & Gemfile Run: “bundler install” Run: “bundler exec jekyll serve” to check if your site works locally If you want your website to work with gh-pages, you should add the name of your repo to the variable “base-url” in your _config.yml

For the midnight theme, which is the one this wiki uses:

+ [Repo link](https://github.com/pages-themes/midnight)
+ [Ruby gems link](https://rubygems.org/gems/jekyll-theme-midnight)

Convert WordPress Blog To Jekyll

Disclaimer: I intend to write a more lenghty answer later.

  1. Install ruby
  2. Gem install bundler jekyll
  3. Jekyll new [blog_name]
  4. Go to wordpress > tools > export > you will obtain an xml file
  5. Copy this xml file in project folder
  6. Install proper dependencies: jekyll-import, github-pages, open_uri_redirections, hpricot
  7. Enter IRB environment with the irb command
  8. Run: ruby -rubygems -e ‘require “jekyll-import”; JekyllImport::Importers::WordpressDotCom.run({ “source” => “YOUR_XML_FILE.xml”} )
  9. Enjoy!

Quick Pass Tutorial

  1. Install pass:
sudo apt install pass # Debian-based distributions
sudo pacman -S pass # Arch-based distributions
  1. Create a GPG key (RSA):
sudo apt install gpg # Debian-based distributions
sudo pacman -S gpg # Arch-based distributions
gpg --gen-key
  1. Initialize pass:
pass init $gpg-id
  1. Add passwords to the password-store
pass add $email/my-email-address # pass add = pass insert
pass insert $this-is-a-secure-password
pass generate $name-of-password $number-of-characters-I-want
  1. Copy, rename, remove a password
pass cp $old-password-name $new-password-name
pass mv $old-password-name $new-password-name
pass rm $an-old-password
  1. Displaying password store
pass ls 
pass # both commands are equivalent
pass $password-name
  1. Show a password
pass show $name-of-password
  1. Copy a password to clipboard

You may also install passmenu, which is a dmenu script to quickly access all your passwords. If you combine it with the power of a tiling window manager, accessing a password becomes a matter of seconds.

pass -c $name-of-password

Virtualization Software

Also known as hypervisors.

Screenshots

Cloud Software

OSI Model And Networking Protocols

You should be aware of the different layers of the OSI (open systems interconnections) model. There are 7 layers:

  1. Physical Layer
  2. Data Link Layer
  3. Network Layer
  4. Transport Layer
  5. Session Layer
  6. Presentation Layer
  7. Application Layer

Here is a non-exhaustive list of protocols you should be aware of: