-Qt for wayland requires qt5-wayland package and "export QT_QPA_PLATFORM=wayland" -You still have tor and "arm" to monitor it -Docker is pretty cool you should use it, https://www.kali.org/news/official-kali-linux-docker-images/ also works with wifite2, it basically is a shell-oriented low-weight high-performance virtual machine wich can run prebuilt docker images or your personal docker images. Docs: https://docs.docker.com/ # ARCH SECTION -Links useful during an arch install: https://wiki.archlinux.org/index.php/Installation_guide https://wiki.archlinux.org/index.php/GRUB https://wiki.archlinux.org/index.php/General_recommendations#Users_and_groups https://wiki.archlinux.org/index.php/EFI_system_partition https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks https://wiki.archlinux.org/index.php/List_of_applications -Pacman commands: "pacman -Syy" update repositories "pacman -Su" update packages "pacman -Qdtq" list unused/orphan packages "pacman -R" remove a package "pacman -S" install a package "pacman -R $(pacman -Qdtq)" remove unused packages "pacman -Rns" remove packages and its dependencies recursively "pacman -Rcs" remove packages and its dependents recursively "pacman -Ql" list all package's files and locations "pacman -Qqe" list all installed packages "pacman -Qc" view package changelog "pacman -Qm" list packages not present in official repositories If you panic just do "sudo pacman -Syy" and then "sudo pacman -Su" "rm -rf /var/lib/pacman/db.lck" remove pacman's transaction lock file (to solve "could not unlock database" error, which happen when pacman is already running) NOTE: If all of a sudden everything is fucked up bad (like no GUI whatsowever) check the pacman log at "/var/log/pacman.log" to see what went wrong and what got removed To manage and download packages from the AUR use: pikaur: https://github.com/actionless/pikaur#installation yaourt (unmantained) These are all wrappers which means they extend some functionalities of pacman to use AUR, for example updating and installing packages (-Syu and -S) NOTE: pacman wrappers don't need to be run as root since it's dangerous to run PKGBUILD as such. Pacman GUI frontends: "pamac" based on gtk and it is the same GUI frontend in the gnome and KDE releases of manjaro, to install use the package "pamac-aur" or "pamac-aur-git" from the AUR. "octopi" is a lightweight GUI frontend for pacman and it is one of the most used ones although it isn't as visually appealing as pamac and requires a gtk sudo permission package such as "blank don't remember" Ranking mirrors based on speed: -Network management Arch uses netctl to manage connections, all the config files and examples are under /etc/netctl/ and /etc/netctl/examples References: https://wiki.archlinux.org/index.php/Netctl https://www.raspberrypi.org/forums/viewtopic.php?t=54080 https://wiki.archlinux.org/index.php/Dhcpcd#Static_profile -Network managers: NetworkManager: default in many distros pretty good but resorce heavy (also depends on systemd?) void: https://docs.voidlinux.org/config/network/networkmanager.html arch: https://wiki.archlinux.org/index.php/NetworkManager Connman: small and fast, does all you need and doesn't hog on resources and has vpn support void: https://wiki.voidlinux.org/Connman arch: https://wiki.archlinux.org/index.php/ConnMan Wicd: outdated by now and written in python 2.7, still pretty good for simple configurations # VOID LINUX SECTION -Hold pkgs form updating hold: xbps-pkgdb -m hold unhold: xbps-pkgdb -m unhold list on hold: xbps-query --list-hold-pkgs # SYSADMIN SECTION -"acpi" is kinda important in laptops "acpi -i" for info, also "thinkpad_acpi" should be noted -Basic commands: GREP: G-REP or "grep" can be used to filter command results: "ps ax | grep whatyouwant" and it will output the line containing "whatyouwant" example "dmesg | grep whatyouwant" NOTE: "|" is used to pipe the output in another program PS: Ps is a UNIX tool used to get information about the current status of the system The most basic and or useful usage is to view all the running processes and the corresponding UUIDs (like if you want to kill process and you need its UUID), that is done by appending "ax" to ps: "ps ax" KILL: It kill the specified process given its UUID, syntax "kill " "|" and ">": These are both "pipe" functions, they can pipe the output of a script or program into something (via std i/o), but they are used differently in the sense that "|" is specifically used to pipe the output into another program EX: "ps ax | grep gnome-shell", this outputs the UUIDs of all the gnome-shell instances since the output of "ps ax" is piped into GREP which in turn returns just the results of the query. On the other hand ">" is used to pipe the output into a file EX: "ls -la > ls.txt", this puts the output of ls into ls.txt which we can then read. "whoami" and "groups": they respectively output the current user and groups NOTE: one alternative to "whoami" is "echo $USER" which can be used in scripts FIND: Sources: https://www.cyberciti.biz/faq/how-do-i-find-all-the-files-owned-by-a-particular-user-or-group/ refer to man for all the available options Basic syntax: "find [OPTIONS]" OPTIONS: "-user " find files owned by a particular user "-group " find files owned by a particular group "-ls" list results in "ls" format: "-name " find a specific file or pattern (*.txt) -Groups: Adding users to groups: "usermod -a -G group user" reboot Listing all groups: "cut -d: -f1 /etc/group | sort" -Users: Creating a new user: useradd -m user-name Deleting an existing user: userdel user-name -Linux afterinstall (how to get thing working): Bluetooth usage: Refers to: https://wiki.archlinux.org/index.php/Bluetooth_headset https://wiki.archlinux.org/index.php/bluetooth Start the "bluetooth.service" service then refer to: Generating locales (languages and language support): Add locales uncommenting them in /etc/locale.gen Run "locale-gen" Reboot NOTE: if installing locales with a specific character set (russian, chinese, japanese) it is needed to also install the specific fonts, refer to: "https://wiki.archlinux.org/index.php/Localization" to find the specific font packages and install them using pacman Getting the graphics drivers: For Intel graphics cards: Refers to: https://wiki.archlinux.org/index.php/intel_graphics mesa lib32-mesa vulkan-intel For nvidia graphics cards: Please refer to: https://wiki.archlinux.org/index.php/NVIDIA#Installation For amd graphics cards: mesa lib32-mesa xf86-video-ati: for Xorg hardware acceleration support mesa-vdpau and lib32-mesa-vdpau: for accelerated video decoding Adding entropy to your system: Refers to: https://wiki.archlinux.org/index.php/Random_number_generation This is useful as the kernel's built-in random number generator is very slow, as such it makes tasks like loading the login manager a pain. To solve this problem you can install some pseudo-random number generators such as: "rng-tools" secure, uses more CPU "haveged" fast and lightweight NOTE: Keep in mind that these are not for secure systems and remember to start and enable the service rngd.service Getting NTFS support working: Refers to: https://wiki.archlinux.org/index.php/NTFS-3G Install the "ntfs-3g" package -Listing installed packages: With apt/apt-get: "apt list --installed" With pacman: "pacman -Qqe" With xbps: xbps-query -m -Changing the default shell To change your default shell to something other than bash use: "chsh -s full-path-to-shell" for example "chsh -s /bin/zsh" to list all installed shells use "chsh -l" -Changing keyboard layout: Source: https://superuser.com/questions/1147320/how-to-change-keyboard-layout-in-i3 In the system console type "layout " In i3, dwm (and possibly other wms) "setxkbmap -layout " -"https://wiki.archlinux.org/index.php/systemd" just helpful -To run .jar files in cli you must use "java -jar" -To list all partitions "sudo fdisk -l" -To list all partition UUIDs "sudo blkid" -Change default file openers: Source: https://wiki.archlinux.org/index.php/XDG_MIME_Applications create a file (if not present) in .config called mimeapps.list search your file extension in https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types add or modify the entry to that mimetype to be opened with the desired app.desktop IF app.desktop IS NOT PRESENT: look again in /usr/share/applications if it is not present make one and put it into: ~/.local/share/applications/ with the format: [Desktop Entry] Name=Xpdf Comment=Views Adobe PDF (acrobat) files Exec=xpdf %f Terminal=false Type=Application Icon=xpdf Categories=Office; MimeType=application/pdf; NOTE: Exec= are the execution parameters -To check a disk's health you need "smartmontools", first check system compatibility with "sudo smartctl -c /dev/sdX" then either do a short test "sudo smartctl -t short /dev/sdX" or a long test "sudo smartctl -t long /dev/sdX" lastly do "sudo smartctl -H /dev/sdX" to get the results -Recompiling compilers for zerynth: If facing compiling errors in zerynth, manually recompile the compiler for the board in ""~/.zerynth2/sys" for example replacing the xtensa-lx106 compiler (esp8266) goes: 1-Move the old compiler folder somewhere safe (~/.zerynth2/sys/xtensa-lx106) 2-Clone and compile (as standalone) new compiler in a temporary folder, guide here -> "http://domoticx.com/sdk-esp8266-xtensa-architecture-toolchain/" 3-Move the newly created compiler folder (xtensa-lx106-elf) in ~/.zerynth2/sys and rename it as the original one (xtensa-lx106/) 4-Copy the old package.json in the new compiler folder Better yet is to wait for an official fix and report the bug on the troubleshooting section Also the same thing has to be done with the xtensa-lx6 compiler (esp32) "https://dl.espressif.com/doc/esp-idf/latest/get-started/linux-setup.html" -Various permission errors: Arduino permissions: Source: https://www.howtogeek.com/50787/add-a-user-to-a-group-or-second-group-on-linux/ "ls -la /dev/tty*" and see which group TTYs are in, then add yourself to that group: "usermod -a -G examplegroup exampleusername" or just use "$USER" to add current user, then reboot. Wireshark permissions: "usermod -a -G wireshark $USER" Pen drive in read only: Refers to: https://www.youtube.com/watch?v=F4lAlb74mGs unmount the pen drive (4exmpl /dev/sdb1) type as superuser "dosfsck -a /dev/sdb1" remount profit -Arduino not starting: Try installing "arduino-avr-core" package -Cannot scroll down in VIM on st: one solution is to add "set ttymouse=sgr" to your .vimrc -DEL key not working in st: source: https://www.reddit.com/r/archlinux/comments/8w4unu/setting_up_the_delete_key_in_st/ add: tput smkx in your zshrc or eqiuvalent -Theming gnome: download the theme packages at "https://www.gnome-look.org/" and unzip them then depending if it is an icon theme or an normal theme place them in "/usr/share/icons" or "/usr/share/themes" accordingly -Printing documents: Refers to: https://wiki.archlinux.org/index.php/CUPS#Installation Install the "cups" package then start and enable it To start a print use whatever printing program you have if you do not have a print manager program you can always open up the web interface in your browser at: localhost:631 NOTE: you might need to add printers and to do so, in some cases like for KDE, you'll need to be logged as root -Adding executables and shortcuts: Refers to: https://askubuntu.com/questions/322772/how-do-i-add-an-executable-to-my-search-path https://unix.stackexchange.com/questions/3809/how-can-i-make-a-program-executable-from-everywhere You have to add them to your $PATH, example: "export PATH="$PATH:$HOME/esp/xtensa-esp32-elf/bin" Quote "If you just type export PATH=$PATH: at the command line it will only last for the length of the session. If you want to change it permanently add export PATH=$PATH: to your ~/.bashrc file (just at the end is fine)." -Eagle CAD dark theme fix (KDE): Refers to: https://forum.kde.org/viewtopic.php?f=17&t=136316 https://forums.autodesk.com/t5/eagle-forum/kubuntu-18-04-kde-dark-theme/td-p/8188466 To fix this behavior you first have to apply the default light theme of KDE (breeze), then copy the kdeglobals file located under ~/.kde4/share/ create a folder named ~/.config_light/ and paste the kdeglobals in it, rename kdeglobals to config_light, then finally add to the eagle start command: "export XDG_CONFIG_HOME=/home/ale/.config_light/ ;" (where ale is your username) or add an alias to the eagle command where it becomes: "export XDG_CONFIG_HOME=/home/ale/.config_light/ ; eagle" NOTE: this will change the default settings folder to ~/.config_light, all previous setting will be lost but not the libraries or projects -Use "clamav" as antivirus: "https://wiki.archlinux.org/index.php/ClamAV", to update use "freshclam" as sudo and to scan "clamscan --recursive --infected /path/to/something" -Some git stuff: Creating a repo and pushing the first commit: "https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/" first init the repo with "git init" then if you want to sync with a remote repo basically it's a matter of defining the remote (origin) repo "git remote add origin " before committing add staged changes with "git add /roba" or everything with "git add ." committing the changes in local repo "git commit -m "message" " pushing before first pull "git pull origin master --allow-unrelated-histories" the last part is just to merge the repos (if needed) and finally pushing the changes "git push origin master", or in atom just publish Using 2 factor auth. in command line and atom: "https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/" basically you have to use a access token instead of the password, these are unique and you can only see them once, so be careful with them! Downloading other branches: In your folder repo open a git bash or a terminal (for linux masterrace) then, admitted that you have already downloaded and synced the master branch, and type "git checkout -t origin/branchname" this will download and sync the branch -Powertop usage: Arch page: https://wiki.archlinux.org/index.php/powertop To start powertop use "sudo powertop" For the first calibration use "sudo powertop --calibrate", NOTE: it takes a few minutes and during that time the screen may go (it does) black for a few minutes too, just let it run. To set everything to "good" do "sudo powertop --auto-tune", to make the auto-tune start at boot refer to the Arch wiki or "how to create a sysemd service" NOTE: in order to apply changes and stuff you have to leave it running for some time to let it take its measures and stuff -Power management: Arch page: https://wiki.archlinux.org/index.php/Power_management#Power_management_with_systemd To change the actions to take when power button or lid switch events occur: modify the conf. file at /etc/systemd/logind.conf or /etc/systemd/logind.conf.d/*.conf -Adding executables not located in /bin/ (downloaded from internet): Refers to: https://askubuntu.com/questions/322772/how-do-i-add-an-executable-to-my-search-path https://unix.stackexchange.com/questions/3809/how-can-i-make-a-program-executable-from-everywhere Adding them momentarily: Add them to your $PATH, example: "export PATH="$PATH:$HOME/esp/xtensa-esp32-elf/bin" Adding them at the start of the session: Using bashrc: Add export PATH=$PATH: (the bin/ folder) to your ~/.bashrc file (just at the end is fine) Using cron: Add export PATH=$PATH: to your crontab file: Open your crontab file using "crontab -e" for current user or "crontab -e -u username" fo others At the end of the file add "@reboot export PATH=$PATH:" NOTE: probably it is best do to add the command in the "su" cron file -Checking system errors: Refers to: https://wiki.archlinux.org/index.php/Systemd#Journal https://www.digitalocean.com/community/tutorials/how-to-use-journalctl-to-view-and-manipulate-systemd-logs If your distro users systemctl the easiest way to check errors is to look up the recent events in the system logs to do that type "journalctl" -Getting the right dpi: (only applies to xorg) Resources: https://wiki.archlinux.org/index.php/Xorg#Display_size_and_DPI First of all get the optimal dpi for your screen: http://dpi.lv/ Then get the current dpi that the server is set on: (requires dpyinfo) xdpyinfo | grep -B2 resolution if it si already set to the right dpi you are good to go, else add to your xinitrc or xprofile (if using a display manager): xradr --dpi -Using android devices: Source: https://wiki.archlinux.org/index.php/Media_Transfer_Protocol Android devices use the MTP interface, to be able to access them in your file manager it is usually required to install the packages: "libmtp" "gvfs-mtp" and "gvfs-gphoto2" If running a KDE installation with dolphin mtp support is integrated into kio-extras (dolphin dependency) NOTE: running multiple mtp tools can cause errors (gvfs-mtp and kio-extras) NOTE: Apple devices require the "gvfs-afc" package, and the "gamin" package is also recommended -File previews on KDE (Dolphin): Please refer to: https://wiki.archlinux.org/index.php/Dolphin#File_previews for the list of packages suitable for different file types -Windows: Adding programs to PATH: Source: https://www.howtogeek.com/118594/how-to-edit-your-system-path-for-easy-command-line-access/ Open: Control panel -> system -> advanced system settings -> environment variables On windows 7 or 8: Set the variable name to "Path" Add the path to the program preceded by ";" ex. "...;C:\path\to\something" On windows 10: Click on "New" Enter the path to the program Retrieving the windows product key: Open a console with admin privileges Type "wmic path softwarelicensingservice get OA3xOriginalProductKey" -Creating a systemd (systemctl) service (aka how to make a program start at boot): Guides and references: https://askubuntu.com/questions/112705/how-do-i-make-powertop-changes-permanent https://wiki.archlinux.org/index.php/powertop https://askubuntu.com/questions/919054/how-do-i-run-a-single-command-at-startup-using-systemd Create a file under /etc/systemd/system/ and call it .service Then follow the formatting { [Unit] Description=PowerTOP auto tune [Service] Type=idle # Not necessary Environment="TERM=dumb" # Not necessary ExecStart=PATHTOEXECUTABLE --OPTIONS [Install] WantedBy=multi-user.target } And then enable it using "systemctl whatever.service enable" Other method: using crontab Reference: https://wiki.archlinux.org/index.php/cron#Crontab_format Install cronie then put your command into the crontab file using "crontab -e" Then follow the formatting according to the reference to specify when the command is executed # LAPTOP OPTIMIZATION -Undervolting the CPU: Refers to: https://wiki.archlinux.org/index.php/Undervolting_CPU https://wiki.archlinux.org/index.php/Stress_testing https://wiki.archlinux.org/index.php/benchmarking WARNING: Overvolting and overheating can result in permanent damage On arch install the package "intel-undervolt" from AUR and edit it's configuration file located in /etc/intel-undervolt.conf, changing the values from 0 to -number results in that number of millivolts taken from the CPU voltage. NOTE: on voidlinux use the pip3 package undervolt follow: https://wiki.voidlinux.org/Undervolting for more info. The following are the parts affected: "CPU" changes the CPU core voltage "GPU" changes the integrated GPU voltage "Cache" changes the cache voltage "System agent" changes the controller, RAM and PCI voltages "Analog IO" changes the various sensors voltage NOTE: changing the System Agent and Analog IO can lead to various errors such as inaccurate readings from sensors crashes and possibly corruption, so it is greatly discouraged One method to undervolt your CPU or GPU is to gradually step down the voltage in 5 or 10 millivolt steps stress testing the system in between for several minutes to ensure the system's stability Some tools used to stress test your system are: "stress" tool written in C used for memory, CPU and disk IO tests "mprime" AUR, tool for stress testing RAM and CPU "unigine-heaven" and the unigine series, although benchmarks they are a great way to stress test the integrated GPUs of laptops -i915 (graphics) tweaks: Refers to: https://gist.github.com/Brainiarc7/aa43570f512906e882ad6cdd835efe57 There are a number of tweaks that can save some watts regarding the integrated graphics card to enable them you can create a file called "/etc/modprobe.d/i915.conf" containing all of them, you can get the complete list of available parameters and their description by running "modinfo -p i915". The file must be filled following the format: options i915 "parameter" Some safe-to-use parameters are: "enable_fbc=1" enables frame buffer compression "enable_dc=1" enables power saving "disable_power_well=0" enables power well Other parameters may include "enable_psr=1" but that doesn't always work on pre-skylake hardware and on newer is straight up broken, it also depends on whether or not the display supports it, for further information refer to: https://hansdegoede.livejournal.com/18653.html NOTE: as every parameter has the potential to cause weird issues it is recommended to test them first by appending them to the boot command (either in GRUB, rEFInd or systemd-boot) using the syntax: i915.enable_dc=1 After having enabled the options you can check if they were correctly applied by running "systool -m i915 -av" as root (systool is part of sysfsutils) NOTE:on voidlinux the modprobe .conf files must go inside /lib/modprobe.d/ and instead of using mkinitcpio to regenerate the initramfs use "dracut --force" -Screen tearing: Refers to: https://wiki.archlinux.org/index.php/Intel_graphics#Tearing Enable the option "TearFree" of the driver: File: /etc/X11/xorg.conf.d/20-intel.conf Content: Section "Device" Identifier "Intel Graphics" Driver "intel" Option "TearFree" "true" EndSection -General tweaks: Use "haveged" instead of "rng-tools" Under KDE uninstall everything PIM or akonadi related Minimize the number of needed applications and daemons -Better battery management: Refers to: https://wiki.archlinux.org/index.php/TLP TLP is a tool daemon which manages the power consumption of your laptop and automatically enables or disables power saving features. To use it install: "tlp", "tlp-rdw" (for radio devices), "acpi_call" (for thinkpads), "tlpui-git" (AUR, GUI frontend) After installing all of the beforementioned packeges be sure to start and enable tlp using systemctl: "sysytemctl start tlp.service" "systemctl enable tlp.service" "systemctl start tlp-sleep.service" systemctl enable tlp-sleep.service" and finally if you installed the radio davice wizard (tlp-rdw) run: "systemctl enable NetworkManager-dispatcher.service" "systemctl mask systemd-rfkill.service" "systemctl mask systemd-rfkill.socket" Reboot and you're all set # NETWORK SECTION -Gathering information on network cards ie IP, MAC, status, etc. With ifconfig, just type "ifconfig" and it will give: ether: the MAC address inet: the network ip address netmatsk: the netmask duh inet6: the network ipv6 With iwconfig (specifically for wireless cards), just type "iwconfig" and it will give: Mode: monitor or managed ESSID: the ESSID (name) of the connected network Frequency Access Point: the MAC address of the AP Signal level: the power/quality of the signal Among other informations Sites for public IP discovery and information gathering: https://www.iplocation.net/ http://www.whatsmyip.org/ With ip (standard) ip link show -Changing the MAC address: Using macchanger: The general usage is "macchanger [OPTIONS] interface", the most common options being -A for a random MAC, -r to reset to the original one, -a to change it to a random MAC of some type (same vendor), -b to set the "locally administered" bit set to false or -m XX:XX:XX:XX:XX:XX to manually set the MAC address. Using ifconfig: First disable the interface using "ifconfig down" Then change the MAC address using "ifconfig hw ether 00:XX:XX:XX:XX:XX" it has to begin with 00:* Then finally re-enable the interface with "ifconfig up" To prevent the MAC address from reverting to its original state you can configure the network manager to not scan for other networks using a random MAC address (that is done for security by many OSs and also by phones), to achieve this you have to change the conf. file for your network manager: For GNOME (kali) add { [device] wifi.scan-rand-mac-address=preserve [connection] ethernet.cloned-mac-address=preserve wifi.cloned-mac-address=preserve } to /etc/NetworkManager/NetworkManager.conf -Changing interfaces to monitor mode: Not mandatory but best use is to first use "airmon-ng check kill", this kills all processes that could interfere with the process and later with the attacks Using airmon-ng: Simply use "airmon-ng start " to put it in monitor mode And "airmon-ng stop " to revert it to managed NOTE: when using airmon-ng it will change the interface name by adding *mon to its name for example wlan0 becomes wlan0mon Using iwconfig (useful since first method is not always reliable): Disable interface using "ifconfig down" or "ifdown " Change to monitor mode with "iwconfig mode monitor" Re-enable interface with "ifconfig up" or "ifup " To revert it back to managed disable the interface then do "iwconfig mode managed" then re-enable the interface -Restarting network interfaces: Without ssh: Disable and re-enable the interface with "ifdown " and then "ifup " or "ifconfig down" and then "ifconfig up" On ssh: Non systemd "/etc/init.d/networking restart" Systemd (Arch) "systemctl restart NetworkManager" -Enabling IP forwarding: Arch page: https://wiki.archlinux.org/index.php/Internet_sharing "echo 1 > /proc/sys/net/ipv4/ip_forward" To revert it back: "echo 0 > /proc/sys/net/ipv4/ip_forward" -Manually changing ip address of a given network card: run: "ip addr add / dev " where ip is the desired ip and mask is the desired network mask in 2 digit format, ex: "192.168.1.2/24" where 24 expands to 255.255.255.0