The Free Wiki
Hello World!
Project maintained by Soimuen11
Table Of Contents
Mounting Android Phones In Linux
- Install simple-mtpfs (from the AUR if you are running Arch Linux)
- Create Android/ directory in your home/
- Run : simple-mtpfs -o enable-move –device 1 Android/
(1 being the device ID)
- Unmount with : fusermount -u Android/
Other solutions to transfer files:
- Use bluetooth (particularly easy with Gnome Control Center)
- For file transfer, you may also install Termux, an android terminal app which
you may find in the Play Store. From there you can set up ssh on your phone.
Installing Android in Vbox
- Download the ISO
- Change motherboard to PS/2 Mouse in System tab
- Change Processors to 2+
- Change Display to 3d and VboxSVGA
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
Weather
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.
- For Arch users:
sudo pacman -S screenkey OR yay -S screenkey
- For Ubuntu users:
sudo apt install screenkey
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
- . - any one character
- * - Match any number of previous (includin 0)
- + - Match any number of previous
- $ - End of the line
- ^ - Beginning of the line
- \S - any non-whitespace character
- \s - any whitespace character
- ? - optional
- [a-z] - any lowercase letter
- [A-Z] - any uppercase letter
- [A-Za-z] - any letter
- [0-9] - any number
-
\ escape something
- Examples:
- grep “something” file
- grep “^s” file -> any line starting with lowercase “s” in given file
- Learning Awk may also come in
handy.
A Chaotic List Of Useful Programs
- Neofetch
- Sxiv: A suckless image viewer for X vith vim keybindings
- Zathura: A document viewer
(don’t forget to download sth to read pdfs along with zathura)
- Neomutt: Cli-based email client
- Sup: An equivalent to neomutt written in ruby
- Noisetorch: Creates a virtual microphone that suppresses noise.
- Ffmpeg
- Vlc / cvlc / nvlc
- Nvlc is vlc with an ncurses interface
- Vlc can play the radio directly from terminal
- Cli-visualizer: A command-line sound visualizer
- Ntfs-3g
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
- Mediawiki
- Wordpress
- Code from scratch with HTML, CSS & JS and then self-host it.
- With GitHub: create a new repository, initialize it with a file named
README.md, go to github pages, pick a theme and publish it.
- With Jekyll + Github pages: To obtain a more customized result than the
precedent one.
- Other amazing tools to build a website from
markdown
Monitor Your System
- cron &/or anacron: Automate repetitive tasks. To edit your cron file,
open a terminal emulator and run:
- dstat: Versatile resource statistics tool
- perf
- aide: Advanced intrusion detection environment
- sendmail / mailx / msmtp / offlineimap: get emails notifying you when an
important automated task has been completed. Combine these programs with cron
jobs.
- notify-send: interact with your system receiving notifications for certain
events. Add this to your scripts / cron jobs.
- top / htop / bashtop: I personally do not use top since htop does a
much better job and has a much more readable interface. For those of you who
enjoy bling, bashtop also is a viable option.
- journalctl: If your OS ships with systemd (this is the case for most
arch-based or debian-based distributions), you can acces the logs with
journalctl. Otherwise, you can still have a look in /var/logs.
Partition Disk
fdisk
sfdisk # From a bash script (to automate disk partitioning)
cfdisk # More readable output than fdisk
Edit Subtitles
- Aegisub: Allows you to edit existing ones
but also to create your own subtitles
Pentesting programs & websites
Analyzing
Password Attacks
Sniffing
- Wireshark
- Tcpdump / Windump (for Windows)
- Steel Central Packet Analyzer
- Capsa Network Analyzer
- Omnipeek Network Analyzer
- Observer Network Analyzer
- Sniff-O-Matic
Other
- Xtightvncviewer
- Dig
- Nslookup
- Peach fuzzer = fuzzing technique
- Wafw00f : check if there’s a firewall on target domain
- Rlogin
- Burpsuite
Xorg Programs
- xbacklight: control screen brightness
- xev: print content of X events
- xrandr / arandr: set size, orientation or reflection of the outputs for a screen.
- setxkbmap: set up your keyboard
Write On Screen
- Check filesystem
- Format with vFat File System
- Format with NTFS File System
- Format with EXT4 File System
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
Vim r!
Write the result of the ls command in a file directly from vim
Create TOCs For Markdown Files
Use this vim plugin to automatically generate a table of contents for your
markdown file:
Main commands:
-
: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.
-
:GenTocRedcarpet
Generate table of contents in Redcarpet link style.
This command is suitable for Jekyll or anywhere else use Redcarpet as its
Markdown parser.
-
:GenTocGitLab
Generate table of contents in GitLab link style.
This command is suitable for GitLab repository and wiki.
-
: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
- Find can be a slow command
- Use broot instead
- Fzf also is very popular and can be used together with bfs.
Modifying images
- ImageMagick (cli tool). imagemagick.org is its
official site. They also have a github page.
- Canva.com: very quick and effective for youtube thumbnails. The
problem is: it is web-based.
- Gimp: Free software, equivalent to photoshop. The problem is: it is very
complex.
- Inkscape
Patching Suckless Software
- clone the repository of the program you want to patch (eg: dmenu)
in .local/repos/
- cd into the repo && run : sudo make install
- download the patches
- run : patch -p1 < name-of-patch.diff
- 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:
- Install offlineimap msmtp, notmuch & neomutt
- Begin configuring offlineimap (first get one account to work, then several
if necessary)
- When done with offlineimap, configure msmtp for one account. If all goes
well, do it for several.
- Link your offlineimap config to neomutt. If you do not know how, the arch
wiki explains it really well on its page regarding offlineimap.
- Do the same for your msmtp config.
- Run “notmuch”, a script will run through the config with you.
- Congrats, you may now consult and send your emails from neomutt.
- Set up a cron job to regularly sync your email (offlineimap + notmuch new)
- Useful programs to combine with neomutt
- 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
- PulseAudio / Pavucontrol / Pulsemixer: For sound control of your system.
- Alsa / Alsamixer: For sound control of your system.
- Audacity: To record audio (and so much more).
- Sox (for terminal): Same as audacity but is terminal-based.
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
- CRUX (source-based)
- Gentoo (source-based)
- Source Mage (source-based)
- LFS (Linux From Scratch = create your own distro)
- Slackware / OpenSuse
- Void Linux
Mother distros
- Slackware
- Debian (comes with binaries)
- Ubuntu (debian-based)
- Sorcerer (source-based)
- Crux (Arch’s big daddy)
- Gentoo / Enoch
- 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:
- Input = whenever you are receiving data (eg from the internet)
- Output = Whenever you are sending data out
- Forward = You see that a lot on routers. When data passes through from one
device to another.
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
- glances : written in Python
- ncdu : ncurses disk usage
- moc: listen to music from your terminal
- cmus: equivalent to moc (I personally prefer moc)
- bastet : a tetris for terminal
- dialog / smenu (programs to interact with the user)
- vifm (vim-like file manager)
- mc (midnight commander) : file-system manager
Recovering deleted files
Spreadsheet Program With Vim Bindings
- SC-IM
- Install it with the AUR on Arch Linux: yay -Ss sc-im
Display Manager Setup
- Permanently change DM:
sudo systemctl disable [$CURRENT-DISPLAY-MANAGER]
sudo systemctl enable [$NEW-DISPLAY-MANAGER]
- Temporarily change DM:
sudo systemctl stop [$CURRENT-DISPLAY-MANAGER]
sudo systemctl start [$NEW-DISPLAY-MANAGER]
- Restart DM:
sudo systemctl restart [$DISLAY-MANAGER-NAME]
Set Keyboard With Setxkbmap
Forever Option 1:
- Create a file : /etc/X11/xorg.conf.d/10-keyboard.conf
- Add lines I added in my current 10-keyboard.conf
Temporarily:
- setxkbmap us
- setxkbmap us -variant intl
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
- A shell program to cd faster, a bit like broot or fzf (though not a fuzzy finder).
- Install it on Ubuntu: sudo apt install autojump
Browser Recommendations
- Iridium is the best one regarding privacy
- Brave & vimium plugin: for its relative security builtin js/ad-blocker & its speed
- Qutebrowser: if you love vim, you will love it
- Firefox with the pentadactyl plugin
FROM WEBSITES:
- Add /feed/ at the end of the url address
FROM YOUTUBE CHANNEL:
- Press ctrl+u to go to the page sources & search for the channelId
- Then copy-paste this url: https://www.youtube.com/feeds/videos.xml?channel_id=YOURCHANNELIDHERE
- Add the channelId where it belongs
INSTALL NEWSBOAT:
- sudo apt install newsboat (debian-based distros)
- sudo pacman -S newsboat (arch-based distros)
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”:
- Nintendo DS (nds): desmume
- GameBoy Advanced (gba): vbam
- PlayStation Portable (psp): ppsspp
- Wii-U: decaf OR Cemu & Wine
- PC: Wine + Playonlinux
- Wii + Gamecube: Dolphin
- Nintendo 64: Mupen64plus
Downloading roms:
Free & OpenSource Games
- 0ad: https://play0ad.com/
- Xonotic: https://xonotic.org/
- Unvanquished: https://wiki.unvanquished.net/wiki/Compiling_the_source#Debian.2FUbuntu
Jekyll Tutorial
One-Page Static Website On Github
- Create a new repo with a readme.
- Add content to the readme.
- Go to Settings > Pages.
- Choose the main branch & a theme.
- 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:
Initialize a Gemfile:
Go to the rubygems website:
- Search for a theme
- Look for LINKS section and click on HOMEPAGE
- This will redirect you to the github repo of your chosen theme.
- Copy the content of the _layouts folder from that repo
- Modify your pages layout accordingly
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.
- Install ruby
- Gem install bundler jekyll
- Jekyll new [blog_name]
- Go to wordpress > tools > export > you will obtain an xml file
- Copy this xml file in project folder
- Install proper dependencies: jekyll-import, github-pages, open_uri_redirections, hpricot
- Enter IRB environment with the irb command
- Run: ruby -rubygems -e ‘require “jekyll-import”; JekyllImport::Importers::WordpressDotCom.run({ “source” => “YOUR_XML_FILE.xml”} )
- Enjoy!
Quick Pass Tutorial
- Install pass:
sudo apt install pass # Debian-based distributions
sudo pacman -S pass # Arch-based distributions
- Create a GPG key (RSA):
sudo apt install gpg # Debian-based distributions
sudo pacman -S gpg # Arch-based distributions
gpg --gen-key
- Initialize pass:
- 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
- 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
- Displaying password store
pass ls
pass # both commands are equivalent
pass $password-name
- Show a password
pass show $name-of-password
- 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:
- Physical Layer
- Data Link Layer
- Network Layer
- Transport Layer
- Session Layer
- Presentation Layer
- Application Layer
Here is a non-exhaustive list of protocols you should be aware of:
- DHCP: Dynamic Host Configuration Protocol
- IP: Internet Protocol (IPv4; IPv6)
- SIP: Session Initiation Protocol
- SMTP: Simple Mail Transfer Protocol
- IMAP: Internet Message Access Protocol
- POP3: Post Office Protocol
- DNS: Domain Name System
- SSH: Secure Shell
- Telnet
- FTP: File Transfer Protocol
- HTTP: Hyper Text Transfer Protocol
- TLS/SSL: Transport Layer Security / Secure Socket Layer
- OSPF: Open Shortest Path First
- LACP: Link Aggregation Control Protocol