How to hard reset an Amazon Kindle 5? First, press and hold the power button for 30 seconds. Second, release the power button and wait for the kindle to restart. After a while, the progress bar appear and kindle is rebooting.
Author: Q A
How to convert HTML file to text on Linux
Posted onHow to convert HTML file to a text on Linux? You can use html2text (can be installed on Fedora by yum install html2text): $ html2text ${html_file} ${html_file} is the html file to be converted. The converted text will be printed to the STDOUT. You can redirect it to a file if it is needed. Adding
Read more
How to replace gdm with lightdm on Fedora
Posted onCinnamon does not work well with gdm. And there is no meaning to use gdm when using Cinnamon. On Fedora, the default one id gdm. How to replace gdm with lightdm on Fedora? First, install lightdm if it is not installed yet: # yum install lightdm lightdm-gtk Then, disable gdm service and make the lightdm
Read more
How to convert seconds since the epoch to a date in Linux?
Posted onHow to convert seconds since the epoch (1970-01-01 UTC) to a date in Linux? For example, Convert the time stamp 1349361711.169942 to Thu Oct 4 22:41:51 HKT 2012 You can use the date command on Linux to convert the time formats. For converting the time stamp 1349361711.169942 to the normal data format: $ date -d
Read more
How to use ibus for inputting Chinese in Cinnamon on Fedora
Posted onHow to use ibus for inputting Chinese in Cinnamon on Fedora 19? By default, ibus is not started. If I manually start it by run $ ibus-daemon The ibus daemon is started and an icon appears in the tray area. However, no Chinese is inputted to the programs even it is turned on in the
Read more
GUI tool to crop PDF file margins on Linux
Posted onAny GUI tools to crop PDF file margins on Linux? I use krop: http://arminstraub.com/computer/krop krop is a simple graphical tool to crop the pages of PDF files. To install krop on Fedora: # yum install krop
How to tell whether the shell is run in screen
Posted onHow to tell whether the shell is run in screen? For example, I run screen and it starts a bash environment. How to tell in the bash, whether it is run by screen or it is a normal bash environment? It can be identified by checking the TERM environment variable: In a bash in screen:
Read more
How to install Cinnamon on Fedora
Posted onHow to install the Cinnamon desktop environment on Fedora 19? On Fedora 19: # yum groupinstall ‘Cinnamon Desktop’ to install the packages needed for the Cinnamon desktop environment. Then, in the login screen, select ‘Cinnamon’ in the “Session” menu and you will start the Cinnamon desktop environment.
How to set the geometry for Gnome 3 under a VNC Server
Posted onWith Gnome 3, I try to start a vncserver with $ vncserver -geometry 1024×768 to start a vnc server with geometry 1024×768, which works well with Gnome 2 before. This also works for twm. However, after I connect to the vnc server, the resolution is not 1024×768. I change the geometry to other resolution and
Read more
HTML form generation from the database and store value into the database
Posted onI have a “t_form” table and a “t_attribute” table. It looks a little bit like below. Form table form_id | form_name | description ———————————– 1 | Laptop | Possible attributes are Model, Screen Size, OS, Cd Player 2 | Mobile | Possible attributes are Model, OS 3 | Tablet | Possible attributes are Model, Screen
Read more
How to delete multiple items from Kindle Library
Posted onThe Kindle Library Web interface only provide interface to delete items one by one. How to delete multiple items from my Kindle Library? This works on Chrome. First, browse deki.js to find the javascript for the “DeKi: Delete Kindle Items” plugin. Press “Ctrl + A” then “Ctrl + C” to copy all the javascript code.
Read more
How to install JRE for Chrome on Linux x86-64
Posted onHow to install JRE for Chrome on Linux x86-64? Use JRE from Oracle on Fedora Linux x86-64 as the example: Download jre from http://java.com/en/download/manual.jsp?locale=en#lin . Select Linux x64. Install it by # yum install jre-7u40-linux-x64.rpm (the downloaded rpm). Make a softlink of the plugin:$ cd ~/.mozilla/plugins/; ln -s /usr/java/jre1.7.0_40/lib/amd64/libnpjp2.so ./ Restart Chrome and browse chrome://plugins/
Read more
How to make a static library (.a) on Linux
Posted onHow to make a static library (.a) on Linux? How to generate a library from C programs in files lib1.c and lib2.c: $ gcc -c lib1.c lib2.c Create a library “libmy.a” using ar: $ ar -cvq libmy.a lib1.o lib2.o You can also list the files in a library with ar: $ ar -t libmy.a You
Read more
How to set an environment variable in bash?
Posted onHow to set an environment variable in bash? The syntax in bash for setting an environment variable is as follows. export VARIABLE=value Note that there is no space among the variable, the equals sign (“=”) and the value. If the value has spaces, the value should be put in quotes. To check it: echo $VARIABLE
Read more
How to set an environment variable in csh?
Posted onHow to set an environment variable in csh? To set an environment variable in csh: setenv VARIABLE value Most commands used to display/manipulate the environment variables for bash are also available for csh: https://www.systutorials.com/qa/476/how-to-set-an-environment-variable-in-bash
How to set and get an environment variable in C on Linux?
Posted onHow to set and get an environment variable in C on Linux? You can use the setenv and getenv POSIX APIs to set and get environment variables. To add or change environment variable: #include <stdlib.h> int setenv(const char *envname, const char *envval, int overwrite); To get value of an environment variable: #include <stdlib.h> char *getenv(const
Read more
How to show the list view in iOS 7’s calendar
Posted onHow to show the list view in iOS 7’s calendar? Is it deleted? The list view is still available in iOS 7’s calendar. To find it, just click the magnifying glass on the top right and you will see the list view.
C++ cout formatting output
Posted onHow to format outputs with cout in C++? You need IO Manipulators <iomanip>: Header providing parametric manipulators. There are also good tutorials on the Web: Output Formatting: http://arachnoid.com/cpptutor/student3.html Formatting Cout Output in C++ using iomanip: http://www.cprogramming.com/tutorial/iomanip.html
How to pipe the stderr to less
Posted onFor example, try to less the error messages generated by the compiler with make | less Use this command: make 2>&1 | less or, if you want stderr only: make 2>&1 >/dev/null | less
g++: sorry, unimplemented: non-trivial designated initializers not supported
Posted ong++ (version g++ (GCC) 4.8.1 20130603 (Red Hat 4.8.1-1)) report: $ g++ -std=c++11 solution.cpp -o sol solution.cpp: In function ‘int main()’: solution.cpp:50:57: sorry, unimplemented: non-trivial designated initializers not supported Stat init_stat {.depth = 0, .moves = tv, .vec = init}; ^ solution.cpp:50:57: sorry, unimplemented: non-trivial designated initializers not supported solution.cpp:50:57: sorry, unimplemented: non-trivial designated initializers
Read more