Posts
Kill Command
$ kill -l 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP 6) SIGABRT 7) SIGEMT 8) SIGFPE 9) SIGKILL 10) SIGBUS 11) SIGSEGV 12) SIGSYS 13) SIGPIPE 14) SIGALRM 15) SIGTERM 16) SIGURG 17) SIGSTOP 18) SIGTSTP 19) SIGCONT 20) SIGCHLD 21) SIGTTIN 22) SIGTTOU 23) SIGIO 24) SIGXCPU 25) SIGXFSZ 26) SIGVTALRM 27) SIGPROF 28) SIGWINCH 29) SIGINFO 30) SIGUSR1 31) SIGUSR2 SIGTERM: The SIGTERM signal is a generic signal used to cause program termination.
Posts
Bash Declare Your Own Function in .Profile File
you may declare your own function in .profile or .bashrc file: example as below
function rmdu { md5 * | sort -k 4 | uniq -f 3 -d | tr -d '()' | cut -d " " -f 2| xargs rm -v } export -f rmdu Don’t forget to run “source ~/.profile” or “source ~/.bashrc”.
Posts
Java Finally
if there is “return” or “exception” before try, finally block won’t be executed. if there is System.exit(0) in try block, finally block won’t be executed. if there is “return” in try block, finally block executes before return. if there is “return” in catch block, finally block executes before return.
Posts
Nagios Install
sudo apt-get install wget build-essential apache2 php apache2-mod-php7.0 php-gd libgd-dev sendmail unzip useradd nagios groupadd nagcmd usermod -a -G nagcmd nagios usermod -a -G nagios,nagcmd www-data cd /home/jxyu wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.3.4.tar.gz tar -xzf nagios-4.3.4.tar.gz ll cd nagios-4.3.4 ./configure --with-nagios-group=nagios --with-command-group=nagcmd make all make install make install-commandmode make install-init make install-config /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers cd /home/jxyu/ wget https://nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz tar -xzf nagios-plugins-2.2.1.tar.gz cd nagios-plugins-2.
Posts
Centos7 Wifi Config
yum install NetworkManager-wifi #networkmanager wifi plugin nmtui #you will see wifi options
Posts
Ubuntu 18.04 Enable Firefox Play Netflix
in order to play netflix in ubuntu 18.04 firefox, below is required:
firefox Preferences > General > enable “Play DRM-controlled content” $ sudo add-apt-repository universe && sudo apt install libavcodec-extra
Posts
Alter_mysql_table_name
In case we want to alter mysql table columns, we need to check how many rows there are. If rows are too many, alter table may cause issues to replications due to memory consumption.
if rows are millions, it’s better to not use alter table and use the following steps:
create new table as you need use “insert into … from select …” mysql> rename table current to current_old, new to current;
Posts
Mysql Server Enable Log_bin
# server_id is mandatory for enable mysql log_bin [mysqld] server_id=1 log_bin=/var/lib/mysql
Posts
ModelAttribute
@ModelAttribute public void modelAttributeTest1(Model model) { model.addAttribute("testdata1A", "test String1"); model.addAttribute("testdata1B", "test String2"); } @ModelAttribute(name="testdata2") public String modelAttributeTest2() { return "test String3"; } @ModelAttribute(value="testdata3") public Address modelAttributeTest3() { return new Address("Beijing", "100000"); } @ModelAttribute public Address modelAttributeTest4() { return new Address("Beijing", "100000"); } @RequestMapping(value="/test5", method=RequestMethod.POST) public String modelAttributeTest5(@ModelAttribute(value="anAddress") Address anAddress, ModelMap model) { model.addAttribute("testdata5A", anAddress.getCity()); model.addAttribute("testdata5B", anAddress.getZipCode()); return "modelAttributeTest"; } @RequestMapping(value="/modelAttributeTest") @ModelAttribute("testdata6") public Address modelAttributeTest6() { return new Address("Hebei", "100003"); }