I am using a shared network and scp to upload files. I do not want to use most of the bandwidth available. How to limit the network rate used by scp in Linux? You can use the -l option of scp to limit the rate of bandwidth. -l limit Limits the used bandwidth, specified in
Read more
Tag: Linux
How to configure interface bonding in Linux?
Posted onHow to configure interface bonding to bound to 2 eth interfaces together in Linux, specifically CentOS/RHEL? This tutorial Configuring Interface Bonding on CentOS/RHEL/OEL 6.x introduces setting up interface bonding well on CentOS / RHEL / OEL 6.
How to resolve a domain name from a specific DNS server instead of the configured one in Linux?
Posted onI would like to check whether the domain name’s IP has changed in the authoritative DNS server. The system’s configured DNS server may still cache the old IP, which is fine. The question is how to query from the authoritative DNS server the new IP? You can use dig – DNS lookup utility to query
Read more
Any good Web browser in command line in Linux?
Posted onWhat suggested web browser in command line? This will be very useful for browsing the Internet from a command line via SSH. You may use Lynx, a fully-featured World Wide Web (WWW) client for users running cursor-addressable, character-cell display devices, in Linux. Homepage: http://lynx.isc.org/ Lynx is a fully-featured World Wide Web (WWW) client for users
Read more
How to disable the coredump function of systemd on Linux?
Posted onI do not want to have coredump for the developing machine using systemd on Linux? How to disable the coredump function of systemd? You can disable coredump function of systemd by adding this line Storage=none to /etc/systemd/coredump.conf For your reference: Storage= Controls where to store cores. One of “none”, “external”, “journal”, and “both”. When “none”,
Read more
Un-exporting an Exported Variable in Bash in Linux
Posted onHow to un-export an imported variable in Bash on Linux? For example, first, I export a variable MODE like export MODE=debug but I want to unexport the MODE (not turn to be `””`, should be truly non-defined). You can export -n MODE or unset MODE For your reference (from the [`bash` manual](https://www.systutorials.com/docs/linux/man/1-bash/)): export [-fn] [name[=word]]
Read more
Maximum allowed file path length for C programming on Linux?
Posted onWhen programming in C on Linux, it is common to allocate a buffer for storing the full path of a file. How to get a safe maximum size for allocating buffers for file paths? The header <linux/limits.h> includes macros for the path and file name length limits. On my system (Fedora 21), it is located
Read more
How to get the directory path and file name from a absolute path in Bash on Linux?
Posted onHow to get the directory path and file name from a absolute path in Bash on Linux? For example, with “/foo/bar/baz.txt”, it will produce: “/foo/bar/” and “baz.txt”. You also have the basename and dirname commands besides of the basename and dirname C API in Linux: [zma@laptop:~]$ p=”/foo/bar/baz.txt” [zma@laptop:~]$ dirname $p /foo/bar [zma@laptop:~]$ basename $p baz.txt
Decrypting a Password Protected RSA Private Key
Posted onI got a password protected RSA private key with headers like (I have the password): —–BEGIN RSA PRIVATE KEY—– Proc-Type: 4,ENCRYPTED DEK-Info: AES-256-CBC,… How to decrypt a password protected RSA private key? You can use the openssl command to decrypt the key: openssl rsa -in /path/to/encrypted/key -out /paht/to/decrypted/key For example, if you have a encrypted
Read more
What about the master branch for local git configuration in a git repository to make it track remote master branch?
Posted onWhat about the master branch for local git configuration in a git repository to make it track remote master branch? You may append these lines to .git/config in your cloned repository directory: [branch “master”] remote = origin merge = refs/heads/master
Good Cinnamon theme for Fedora 21 Linux?
Posted onAny suggestion on good theme configuration for Fedora 21 Linux? My favorite combination of Window borders, Icons, Controls, Mouse Pointer and Desktop is as follows. All packages and themes are from Fedora repository or the Cinnamon repository. Remember to set the cursor theme for QT application like Google Chrome following: https://www.systutorials.com/4068/configuring-mouse-cursor-style-for-qt-applications-in-gnome-mate-desktop/ For this configuration, the
Read more
How to make Chrome on iPhone (iOS) accept self assigned ssl keys fir websites?
Posted onThis tutorial introduces how to make Chrome accept self assigned ssl keys for websites: https://www.systutorials.com/50204/making-chrome-accept-self-signed-certificates-on-linux/ However, on iPhone, Chrome blocks me from access sites with self assigned keys. How to make Chrome on iPhone also accept the ssl keys? At the time when I wrote this reply, there is no way to add Certificate Authorities
Read more
How to fix “Your profile could not be opened correctly.” on Linux?
Posted onI experience the program on Linux (Fedora 12) that Chrome reports “Your profile could not be opened correctly.” as follows. How to fix it? Restarting Chrome would not help. Removing the ‘Web Data’ directories from all profiles works for me (Making backup first as the commands will remove your files): cd ~/.config/google-chrome find ./ -name
Read more
How to redirect STDOUT of sudo command on Linux and write to file as root?
Posted onA try like the following command failed $ sudo echo “echo hello” > /usr/local/bin/hello with an message bash: /usr/local/bin/hello: Permission denied It seems the writing to the file is executed under the non-root user. How to redirect STDOUT of sudo command on Linux and write the content to the file (/usr/local/bin/hello here) as root? You
Read more
How to check whether a USB disk is connected to a Linux server?
Posted onI can only connect to a Linux server by SSH. How to check whether a USB disk is connected to the Linux server? 2 ways I usuaully use: Method One: Check the print out of dmesg After the USB storage is connected and detected by Linux, it may print some messages containing “[sde]” (the new
Read more
How to allow non-root users on Linux to mount and unmount disks?
Posted onOn a Linux box, we may allow non-root users mount and umount certain disks, such as /dev/sde1. How to allow non-root users on Linux to mount and unmount disks? Please check the tutorial at Controlling Filesystem Mounting on Linux by Playing with /etc/fstab: Allow non-root users to mount and unmount filesystems.
How to convert all text from upper case to lower case on Linux?
Posted onHow to convert all text in a file from upper case to lower case and vice versa on Linux? Convert from upper case to lower case: tr ‘[:upper:]’ ‘[:lower:]’ < input.txt > output.txt Convert from lower case to upper case: tr ‘[:lower:]’ ‘[:upper:]’ < input.txt > output.txt
Good tutorials for screen on Linux
Posted onAny suggestions on good tutorials for screen on Linux? To start with screen: A quick tutorial on screen. After can use the basic functions of screen, you may check out A dummies introduction to GNU Screen and A guide to GNU Screen. During all the progresses, frequently check the screen man page.
how to integrate MySQL client into self designed database
Posted onCurrently, I need to integrate MySQL client into SQLE as SQLE’s client. And then, we just need design/implement a translation layer to transfer MySQL protocol into SQLE engine part (KV+ internal exactly). Mysql-Proxy could solve this problem but it is complex to be only a MySQL server. Therefore, I remoduled MySQL-proxy to be more simple
Read more
How to email admins automatically after a Linux server starts?
Posted onManaging a cluster of servers, I would like to notified when a server is started. How to make the Linux servers email me or other admins automatically after they are started? I did this by adding a crontab entry on each servers like @reboot date | mailx -S smtp=smtp://smtp.example.com -s “`hostname` started” -r zma@example.com zma@example.com
Read more