ALL
Gracefully exiting from console programs in Ruby
Imagine you write a CLI program or a Rake task which loops through some data performing some work on it. You run it and then you remembered something. You’d love to kill the process with ctrl-c, but that will raise an exception somewhere in the loop. What you want is for the iteration to complete and then you want the program to quit.You could handle the Interrupt exception or add some conditions. But how about a cleaner and reusable way?No problem - you can trap signals, which means we can trap the ctrl-c (which is an INT signal). Servers, like unicorn, use signals for graceful restart...
6,744 0 RUBY CONSOLE EXIT COMMAND WINDOW GRACEFUL
Run MySQL on Command Line in Windows
Sometimes if we want to run MySQL but we don't have phpMyAdmin installed. What should we do?On Windows we can run MySQL in following steps:Open Console Window->Type "mysqld -u root". This means we start the mysql server with username root. This program will handle all the communications between our console window and the actual data;After starting the server, we need to use a client to connect to the server and communicate with it. the mysql program is right for this. Next in the command console, we type "mysql -u root -p" to connect the server. By default, after the installation,the defaul...
8,646 0 MYSQL CONSOLE COMMAND LINE WINDOWS DEFAU