Here are links to some useful Linux tips:
https://www.cyberciti.biz/faq/linux-unix-appleosx-bsd-cat-command-examples/
https://peteris.rocks/blog/htop/
https://www.cyberciti.biz/faq/searching-multiple-words-string-using-grep/
https://www.cyberciti.biz/faq/using-sed-to-delete-empty-lines/
https://www.cyberciti.biz/faq/linux-hide-processes-from-other-users/
https://www.cyberciti.biz/faq/bash-check-if-process-is-running-or-notonlinuxunix/
https://www.cyberciti.biz/faq/unix-linux-bsd-appleosx-bash-assign-variable-command-output/
https://bash.cyberciti.biz/file-management/linux-shell-script-to-reduce-pdf-file-size/
https://www.cyberciti.biz/faq/bash-file-command-not-found-how-to-install-file/
https://www.cyberciti.biz/faq/set-up-a-basic-iptables-firewall-on-amazon-linux-ami/
https://www.cyberciti.biz/faq/fedora-redhat-centos-5-6-disable-firewall/
https://hackertarget.com/ossec-introduction-and-installation-guide/
Awesome. VIM “for people who don’t want to use it , but have to…”. Or see my page https://www.cyberciti.biz/faq/linux-unix-vim-save-and-quit-command/
sudo is the right choice for granting admin rights on the CentOS Linux 8 server. Learn how to create a new user and grant her admin rights https://www.cyberciti.biz/faq/add-create-a-sudo-user-on-centos-linux-8/
638 Comments
Tomi Engdahl says:
https://hackaday.com/2020/05/20/using-valgrind-to-analyze-code-for-bottlenecks-makes-faster-less-power-hungry-programs/
Tomi Engdahl says:
https://hackaday.com/2020/06/01/python-is-all-youll-ever-need-in-this-linux-distro/
Tomi Engdahl says:
https://hackaday.com/2020/05/28/peeking-inside-executables-and-libraries-to-make-debugging-easier/
Tomi Engdahl says:
Beam Your Program To Another Computer
https://hackaday.com/2020/04/28/beam-your-program-to-another-computer/
If you’ve programmed much in Linux or Unix, you’ve probably run into the fork system call. A call to fork causes your existing process — everything about it — to suddenly split into two complete copies. But they run on the same CPU. [Tristan Hume] had an idea. He wanted to have a call, telefork, that would create the copy on a different machine in a Linux cluster. He couldn’t let the idea go, so he finally wrote the code to do it himself.
https://thume.ca/2020/04/18/telefork-forking-a-process-onto-a-different-computer/
DMTCP (Distributed MultiThreaded Checkpointing) transparently checkpoints a single-host or distributed computation in user-space — with no modifications to user code or to the O/S. It works on most Linux applications, including Python, Matlab, R, GUI desktops, MPI, etc. It is robust and widely used (on Sourceforge since 2007).
http://dmtcp.sourceforge.net/
Tomi Engdahl says:
https://unix.stackexchange.com/questions/82561/convert-a-hex-string-to-binary-and-send-with-netcat
https://stackoverflow.com/questions/43919867/sending-a-hex-string-to-a-remote-via-netcat
Tomi Engdahl says:
How to install and use vtop graphical terminal activity monitor on Linux https://www.cyberciti.biz/faq/how-to-install-and-use-vtop-graphical-terminal-activity-monitor-on-linux/
Tomi Engdahl says:
Find and delete log files older than 90 days on Linux or Unix:
find /app/logs/ -name “*.log” -type f -mtime +90 -ls # list it
Now delete it:
find /app/logs/ -name “*.log” -type f -mtime +90 -delete
Tomi Engdahl says:
What’s The Deal With Snap Packages?
https://hackaday.com/2020/06/24/whats-the-deal-with-snap-packages/
Who would have thought that software packaging software would cause such a hubbub? But such is the case with snap. Developed by Canonical as a faster and easier way to get the latest versions of software installed on Ubuntu systems, the software has ended up starting a fiery debate in the larger Linux community. For the more casual user, nap is just a way to get the software they want as quickly as possible. But for users concerned with the ideology of free and open source software, it’s seen a dangerous step towards the types of proprietary “walled gardens” that may have drove them to Linux in the first place.
Tomi Engdahl says:
How to Install Snapcraft on Ubuntu/CentOS
https://www.liquidweb.com/kb/how-to-install-snapcraft-on-ubuntu-centos/
What is Snapcraft?
Snapcraft is a command-line utility for building snaps. This software allows users to build their own applications or software packages, and then publish them to the Snap store to be shared and utilized by other users! In this tutorial, we will learn how to install Snapcraft on Ubuntu and CentOS.
What is Snap?
Snap, also known as Snappy, is a popular package management system for Linux that provides access to self-contained packages called snaps. The thing that sets Snap apart from other package management systems like yum or apt-get is that it isn’t specific to just one Linux distribution. Yum, for example, is the default package manager for Fedora, CentOS, and Redhat, but distributions like Ubuntu and Debian use apt-get as the default package manager. Snap packages work on both Debian and RHEL based distributions because Snap encapsulates its own dependencies.
Pre-flight Check
CentOS requires access to the EPEL package repository to install snapd, which is a prerequisite to installing Snapcraft. Here is a tutorial on how to set up the epel repository.
These instructions are being performed on CentOS 7 and Ubuntu 18.04 LTS servers, respectively.
Ensure you are logged into these servers as the root user.
Tomi Engdahl says:
A Life Configuring Emacs
https://github.com/alhassy/emacs.d
Tomi Engdahl says:
https://github.com/carlini/printf-tac-toe
Tomi Engdahl says:
https://www.hackster.io/news/microzed-chronicles-device-trees-92566170bb51
Tomi Engdahl says:
https://www.cyberciti.biz/faq/how-to-delete-a-ufw-firewall-rule-on-ubuntu-debian-linux/
Tomi Engdahl says:
If you’re a Linux user, then you may find this kinda cool!
Someone registered the domain ‘cheat.sh’ and made it a cheatsheet system for Linux. You can access it with a browser, but If you access it with curl from the command line the server detect that will respond with a colorized text-based cheatsheet for your terminal. They put various commands and programming cheatsheets under dirs (example: cheat.sh/find would give you a cheat sheet on the find command.)
Server code is available on GitHub as well:
https://github.com/chubin/cheat.sh
Brilliant project and use of that domain in my opinion!
Tomi Engdahl says:
Linux-Fu: Parallel Universe
https://hackaday.com/2020/06/29/linux-fu-parallel-universe/
Tomi Engdahl says:
Learn tips and tricks to exclude files when using the scp and rsync command on your Linux/macOS/*BSD or Unix-like desktop.
https://www.cyberciti.biz/faq/scp-exclude-files-when-using-command-recursively-on-unix-linux/
Tomi Engdahl says:
Getting notified when tasks complete or failed is essential to avoid service down. So today will explain how developers and sysadmin can send push notifications to their phones powered by iOS or Android from a Linux/Unix shell prompt or scripts. https://www.cyberciti.biz/mobile-devices/android/how-to-push-send-message-to-ios-and-android-from-linux-cli/
Tomi Engdahl says:
Are you looking to gain a bit of performance and speed out of your NGINX web server? Try enablin gzip option on fly to compress responses. See how to enable and use gzip compression with Nginx web server https://www.cyberciti.biz/faq/how-to-enable-the-gzipdeflate-in-nginx-server-on-linux-or-unix-system/
Tomi Engdahl says:
The Linux Mint project has made good on previous threats to actively prevent Ubuntu Snap packages from being installed through the APT package-management system without the user’s consent. This move is the result of “major worries” from Linux Mint on Snap’s impact with regard to user choice and software freedom.
Linux Mint drops Ubuntu Snap packages
https://lwn.net/SubscriberLink/825005/6440c82feb745bbe/
Tomi Engdahl says:
Want to rename multiple files at Linux or macos/unix shell? Try these tips
https://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html #sysadmin #opensource
Tomi Engdahl says:
https://github.com/nerdgeneration/www.sh
Tomi Engdahl says:
https://en.wikipedia.org/wiki/Fork_bomb
Tomi Engdahl says:
Do you want to display a super cool logo of your Linux/Unix distribution along with basic hardware information? Look no further try awesome screenfetch & linux_logo utilities to display logo with hardware configuration on screen. https://www.cyberciti.biz/open-source/command-line-hacks/howto-display-linux-logo-in-bash-terminal-using-screenfetch-linux_logo/ #macos #opensource #linux
Tomi Engdahl says:
Here is a quick guide download/get source code of package using the apt command on Debian or Ubuntu Linux. Sysadmins/developers can apply a custom patch or add/remove the feature and rebuild it.DEB file as per our needs. https://www.cyberciti.biz/faq/how-to-get-source-code-of-package-using-the-apt-command-on-debian-or-ubuntu/ #OpenSource
Tomi Engdahl says:
{Updated} Let us see various commands for Linux to check memory usage.
https://www.cyberciti.biz/faq/linux-check-memory-usage/
Tomi Engdahl says:
https://www.facebook.com/126000117413375/posts/3669143883098963/
This Unix geek is more than socially awkward.
He’s socially perlward.
Get with the times. They are socially Ansibleward
This comment was just waiting to be sed.
Tomi Engdahl says:
https://www.cyberciti.biz/faq/linux-unix-vim-save-and-quit-command/
Tomi Engdahl says:
10 Linux commands to know the system
https://www.cyberciti.biz/open-source/linux-commands-to-know-the-system/ #opensource Let me know if you found this useful here or in the comment section itself
Tomi Engdahl says:
JavaScript Evaluator for Shell Scripts: Basho lets you to write complex shell tasks using plain JavaScript. It mixes well with shell commands and scripts; so you can choose the best tool for the job. https://bashojs.org/
Tomi Engdahl says:
{ Updated } In this quick blog post, we will see how to list and delete all iptables firewall rules using the command line options.
https://www.cyberciti.biz/tips/linux-iptables-how-to-flush-all-rules.html #OpenSource #Linux #Sysadmin #IT
Tomi Engdahl says:
Linux Check Ram Speed and Type Commands: Learn how to check RAM speed and type (line DDR or DDR2 or DDR3 or DDR4) using the CLI https://www.cyberciti.biz/faq/check-ram-speed-linux/
Tomi Engdahl says:
My top and frequently used git commands from shell history in sorted order:
git add
git clone
git commit
git pull
git push
git reset
git rm
git status
There is also xkcd https://xkcd.com/1597/
Tomi Engdahl says:
https://hackaday.com/2020/07/23/linux-fu-keep-in-sync/
Tomi Engdahl says:
https://gitlab.com/remigirard28/MollyEskam-Linux
Installing this distribution will transform your computer into a website (with SSL) that can be published on the internet (www.mollyeskam.net as default template).
Tomi Engdahl says:
How to find Public IP address AWS EC2 or Lightsail VM
https://www.cyberciti.biz/faq/how-to-find-public-ip-address-aws-ec2-or-lightsail-vm/
Tomi Engdahl says:
https://www.howtogeek.com/682244/how-to-use-the-fd-command-on-linux/
Tomi Engdahl says:
{Updated} Linux Show All Members of a Group Command https://www.cyberciti.biz/faq/linux-list-all-members-of-a-group/ #sysadmin #opensource #linux #sysadmin
Tomi Engdahl says:
Remember boothole bug in grub and other packages that bricked servers? Here is how to hold back packages (blacklist) on an Ubuntu / Debian Linux to prevent updating of a specific package or version. https://www.cyberciti.biz/faq/apt-get-hold-back-packages-command/ #sysadmin #linux #OpenSource
Tomi Engdahl says:
Explains how to pass a parameter/value to a Bash function, including listing and deleting user-defined functions. https://bash.cyberciti.biz/guide/Pass_arguments_into_a_function
Tomi Engdahl says:
Learn how to configure Ubuntu 20.4 LTS server and add a network bridge (br0) with the nmcli command https://www.cyberciti.biz/faq/ubuntu-20-04-add-network-bridge-br0-with-nmcli-command/ #sysadmin #opensource
Tomi Engdahl says:
True story before I discovered such scripts https://www.cyberciti.biz/faq/howto-setup-openvpn-server-on-ubuntu-linux-14-04-or-16-04-lts/ Lmao.
Tomi Engdahl says:
This in-depth tutorial provides instructions on how to install and configure KVM on Ubuntu 20.04 LTS headless Linux server, including setting up your first VM. https://www.cyberciti.biz/faq/how-to-install-kvm-on-ubuntu-20-04-lts-headless-server/ #sysadmin #IT #OpenSource
Tomi Engdahl says:
bashtop – Awesome Linux resource monitor that shows usage and stats for processor, memory, disks, and network
https://www.cyberciti.biz/open-source/command-line-hacks/bashtop-awesome-linux-resource-monitor-tool/
Tomi Engdahl says:
{Updated} How to check the file size in Linux/Unix bash shell scripting https://www.cyberciti.biz/faq/howto-bash-check-file-size-in-linux-unix-scripting/ #opensource
Tomi Engdahl says:
Linux Fu: Remote Execution Made Easy
https://hackaday.com/2020/08/11/linux-fu-remote-execution-made-easy/
If you have SSH and a few other tools set up, it is pretty easy to log into another machine and run a few programs. This could be handy when you are using a machine that might not have a lot of memory or processing power and you have access to a bigger machine somewhere on the network.
However, there are a few problems with that scenario. First, you might not have the software on the remote machine. Even if you do, it might not be the version you expect or have all the same configuration as your local copy. Then there’s the file problem. the input file should come from your local file system and you’d like the output to wind up there, too. These aren’t insurmountable, of course. You could install the program on the remote box and copy your files back and forth manually. Or you can use Outrun.
There are a few limitations, though. You do need Outrun on both machines and both machines have to have the same CPU architecture. Sadly, that means you can’t use this to easily run jobs on your x86-64 PC from a Raspberry Pi. You’ll need root access to the remote machine, too. The system also depends on having the FUSE file system libraries set up.
A Complex Implementation
How does this work? A FUSE file system mounts your local filesystem remotely using a lightweight RPC file system. Then a chroot makes the remote machine look just like your local machine but — presumably — faster. There are a few other things done, such as setting up the environment and current directory.
The chroot, by the way, is why you need root on the remote machine. As an ordinary user, you can’t pivot the root file system to make this trick work.
To improve performance, Outrun caches system directories and assumes they won’t change over the life of the command. It also aggressively prefetches using some heuristics to guess what files you’ll need in addition to the one that the system asked for.
Then again, you could do something like this pretty easily with sshfs and some other tricks. If you want to run a program on a bunch of remote machines, there are ways to do that, too.
https://github.com/Overv/outrun
Tomi Engdahl says:
Quick tip: How to use find command to exclude/ignore files (e.g. Ignore all hidden .dot files while using find command )
https://www.cyberciti.biz/faq/find-command-exclude-ignore-files/
#Linux
Tomi Engdahl says:
Let us find out why is it a good idea to use #!/usr/bin/env bash instead of #!/bin/bash as shebang? https://www.cyberciti.biz/tips/finding-bash-perl-python-portably-using-env.html #Linux #Unix
Tomi Engdahl says:
Bruteforce attacks. Follow my tips to secure your OpenSSH server
https://www.cyberciti.biz/tips/linux-unix-bsd-openssh-server-best-practices.html
Tomi Engdahl says:
Let us see how to add or subtract N days from the given/current date on Linux, macOS and FreeBSD Unix system.
https://www.cyberciti.biz/faq/how-to-add-days-to-date-and-get-new-date-on-linux/
Tomi Engdahl says:
Learn how to ignore bash aliases or functions when running a command without removing alias or function from memory or current shell session on a Linux, macOS, or Unix-like systems.
https://www.cyberciti.biz/faq/ignore-shell-aliases-functions-when-running-command/
#opensource