How to understand some key system consistency algorithoms

Posted on

When we design a system, we may want our systems to be consistency, scalability and so on. Currently, there are some famous consistency algorithms. How to understand them easily. 1, Paxos and its extensions 2, Replicated State Machine mechanisms 3, Quorum Welcome to adding other famous consistency algorithms and its understanding ;-) Reading text books
Read more

How to display chinese character in lxterminal

Posted on

Do you know how to display chinese character in lxterminal? I tried to install lxterminal on my workstation and it seems display Chinese characters well: FYI, my Linux system is Fedora 21. The lxterminal version: $ rpm -q lxterminal lxterminal-0.1.11-10.fc21.x86_64 Not sure what’s the reason why it does not work for you. You may check
Read more

How to log connections hitting certain rules in iptables on Linux?

Posted on

How to log connections hitting certain rules in iptables on Linux? Like the one that are dropped because of too frequently creating SSH connections. You can create a new chain named LOGNDROP that log the connections and drop them, then pass the connection to be redirected to the LOGNDROP chain. $tables -N LOGNDROP # Connections
Read more

Basic iptables configuration for Linux

Posted on

What is a good basic iptables config? Basic rules needed: Allow incoming TCP to 22 for SSH but blocks all others. Allow outgoing TCP/UDP connections. You may consider using the following rules as a start: for tables in iptables ip6tables ; do # Flush existing rules $tables -F # Default policy $tables -P INPUT DROP
Read more

How to configure iptables on Linux Mint 17.1?

Posted on

How to configure iptables and make the configuration persistent across system restarting on Linux Mint 17.1? You can use the ‘iptables-persistent’ tool. To install iptables-persistency pachage: sudo aptitude install iptables-persistent The you can manipulate the iptables by the ‘iptables’ command. To save the current iptables rules: sudo /etc/init.d/iptables-persistent store It will store the rules for
Read more

How to use iptables to limit rates new SSH incoming connections from each IP on Linux?

Posted on

How to use iptables to limit rates new SSH incoming connections from each IP on Linux? For example, at most 6 SSH connection attempts every 60 seconds. You may use these rules (skip the first one, if you have set the basic rules): for tables in iptables ip6tables ; do # Allow established inbound connections
Read more

How to upgrade packages installed by ELPA in Emacs?

Posted on

ELPA manages packages for Emacs nicely. But, how to upgrade packages installed by ELPA in Emacs? Within Emacs, list all packages by M-x list-packages and it will automatically refresh the archive contents. Then, press U to mark all upgradable packages to be upgraded. Last, press x to perform the new updates. Emacs will then download
Read more

Find Available Packages Versions using aptitude in Ubuntu

Posted on

How to find the available packages’ versions with aptitude on Linux? With aptitude, you can use this command to show the available versions of a package: aptitude versions <package name> In the console GUI, aptitude also show the versions. You may also simulate installation of a package and see which version will be installed: aptitude
Read more

How to install musl libc on Linux Mint 17?

Posted on

How to install musl libc on Linux Mint 17/Ubuntu 14.04? You can install musl libc on Linux Mint 17 by sudo aptitude install musl musl-dev musl-tools One note: If you want to install a newer version of musl libc than the one from Ubuntu repo, you can use this ppa: https://launchpad.net/~bortis/ archive/ubuntu/musl by sudo add-apt-repository
Read more

How to find the number of files in each directories on Linux?

Posted on

How to find the number of files in each sub-directories of a directory on Linux? For example, . ├── a19 ├── a8 ├── d2 ├── ecfddd └── t1 The number of sub-directories can be quite large. How to find the number of files in each sub-directories here? You can use this piece of script to
Read more

How to pull your git tree after creating it on remote server

Posted on

Currently, I have created my branch dev-harry but I cannot pull it successfully as follows. harryxiyou@common_vm ~/forest/kvplus/kvplus $ git branch * dev-harry master rc harryxiyou@common_vm ~/forest/kvplus/kvplus $ git pull You asked me to pull without telling me which branch you want to merge with, and ‘branch.dev-harry.merge’ in your configuration file does not tell me, either.
Read more

How to exclude directories with certain names from rsync on Linux?

Posted on

How to exclude directories with certain names like “cache” from rsync on Linux during backup? The “cache” directory may in many different paths, such as file1/cache/ or file2/cache/, and adding all “cache” directories to rsync command is not a doable way. You can use rsync with –exclude=cache/ like rsync -avxP –exclude=cache/ /path/to/src/directory/ /path/to/dst/dir/

How to check the DNS I am using on Linux?

Posted on

My Linux distro is Linux Mint 17 (Ubuntu 14.04.1 LTS (Trusty Tahr)). I am using NetworkManager. The old trick does not work: $ cat /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND — YOUR CHANGES WILL BE OVERWRITTEN nameserver 127.0.1.1 If you are using
Read more