Trying to get your q2a theme. Is there a way you could send it on to me please? Would be incredibly appreciated The theme of the site ( https://www.systutorials.com ) is http://wordpress.org/themes/twentyfourteen with minor modifications. Some other features you find on the site are through plugins and HTMLs. If you are asking for the Q2A
Read more
Category: Tutorial
How to calculate the average of value in lines of a text file on Linux by a script?
Posted onHow to calculate the average of value in lines of a text file on Linux by a script? The file.txt is like: Run 0: Time used: 22.235331711 seconds. Run 1: Time used: 20.784491219 seconds. Run 2: Time used: 21.851638876 seconds. What I want it to calculate the average time. awk is handy for this purpose:
Read more
Setting sbt log level at the command line
Posted onsbt‘s log level can be set by execute set logLevel := Level.Error inside sbt. How to set the sbt log level at the command line? Add –error to sbt for specify the logLevel to error: sbt –error “your command”
Patching with git
Posted onTutorials on how to create patches and apply patches with git. A nice tutorial: https://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git/ Manuals: git format-patch: https://www.systutorials.com/docs/linux/man/1-git-format-patch/git apply: https://www.systutorials.com/docs/linux/man/1-git-apply/
How to install multiple versions of sbt on my Linux host?
Posted onHow to install multiple versions of sbt on my Linux host For example, some projects use 0.12.x while some use 0.13.x. Installing neither in the system only is not sufficient enough. You may use the excellent sbt-extras: https://github.com/paulp/sbt-extras Most of the time, it detects the version of sbt needed in the project direoctory automatically: [zma@office
Read more
How to package a Scala project to a .jar with sbt?
Posted onHow to package a Scala project to a .jar file with sbt? Manually packaging the .class files are fine but too tedious. A jar of just the project classes The command: sbt package will produces the main artifact as a jar into target/scala-2.x.y/project_name_2.x.y-zz.jar. Continuously building the package: sbt ~package Standalone jar with all dependencies If
Read more
How to get the time at millisecond level on Linux with command line?
Posted onI know that gettimeofday() is a nice API. But how to get the number of seconds with milliseconds since the epoch time? You can get the time at nano-seconds level (although it is not guaranteed that the last digits are accurate) by: date +%s.%N
How to get the file length in C on Linux
Posted onHow to get the file length in C on Linux given the address of the file (e.g. “/tmp/a.txt”)? This function returns the length of the file: #include <sys/stat.h> long file_length(char *f) { struct stat st; stat(f, &st); return st.st_size; }
How to Import a CMake project into Eclipse CDT?
Posted onHow to Import a CMake project into Eclipse CDT? For example, the current CMake project source directory is ./src. mkdir ./cdt && cd ./cdt && cmake -G “Eclipse CDT4 – Unix Makefiles” ../src cmake will generate a Eclipse project in ./cdt and you can open it in Eclipse.
How to catch the kill signals sent by kill in C on Linux?
Posted onHow to catch the kill signals sent by the kill command in C programs on Linux? For example, I have a daemon progd running, and will kill it by: pkill progd The question is how to catch the signal sent by the kill command and response to it in the progd program implemented in C
Read more
How to Wrap and NOT Wrap Lines in vim
Posted onHow to Wrap and NOT Wrap Lines in vim? Make vim wrap lines: :set wrap For not wrap which will be useful when reading some data result such as logs: :set nowrap It can also be written into the .vimrc config files
How to force yum not to update certain packages?
Posted onHow to force yum not to update certain packages, such as kernel? I manually compiled a kernel module for a specific kernel version. As long as it works well, I do not want to update it. Another example is that I want a specific version of sbt. How to force yum exclude it from being
Read more
Git branching tutorial
Posted onGood tutorials on git branching. The “Git Branching” chapter of Pro Git book is the best one that I ever seen: http://git-scm.com/book/en/Git-Branching It deserve the time to study the whole chapter. If you are working with a git server, this chapter is especially useful: http://git-scm.com/book/en/Git-Branching-Remote-Branches
Add my own window.onload safely without overwriting old ones
Posted onMy webpage has one existing window.onload javascript function defined by a javascript plugin in the <head> section. Now, I defined a new one and add it to the end of the HTML page: <script type=”text/javascript”> window.onload = function () { // great work here } </script> I find the new one overwrites the old one
Read more
Formatting code shortcuts in Eclipse
Posted onFormatting code shortcuts in Eclipse. Shortcut: Ctrl + Shift + F No need to select the code.
How to make thunderbird not wrap lines automatically?
Posted onHow to make thunderbird not wrap lines automatically? Check Making Thunderbird Not Wrap Lines Automatically: Setting mail.compose.wrap_to_window_width to true.
How to force ibus to restart in Gnome 3?
Posted onHow to force ibus to restart in Gnome 3? There used to be a menu. But it does not provide the restart option anymore. To kill current ibus daemon: pkill -o ibus-daemon To start a new ibus daemon in Gnome 3, run this command in “Enter a command” tool by Alt+F2: /usr/bin/ibus-daemon –replace –xim –panel
Read more
Emacs highlighting part of lines that go over 80 chars
Posted onHow to make Emacs highlighting part of lines that go over 80 chars? I use the whitespace mode: ;; `lines-tail`, highlight the part that goes beyond the ;; limit of `whitespace-line-column` (require ‘whitespace) (setq whitespace-style ‘(face empty tabs lines-tail trailing)) (global-whitespace-mode t) More: https://github.com/zma/emacs-config/blob/master/.emacs Alternatively, you can run highlight-lines-matching-regexp with the expression .{81}. http://stackoverflow.com/questions/6344474/how-can-i-make-emacs-highlight-lines-that-go-over-80-chars
Running Chrome over SSH tunnel
Posted onHow to run Chrome on remote host over a SSH tunnel? This way, I can access resource that can only be accessed inside the remote host’s network. Running Chrome over a SSH tunnel is much easier than running Firefox over SSH from a Linux host: First, ssh to the remote host with -X option: ssh
Read more
How to install IE under wine on Linux?
Posted onHow to install IE under wine on Linux? Just need it for some testing. Do not want to reboot to Windows. We ever had ies4linux. But it is obsoleted now. linie is the latest effort. But there are issues and you may need to fix some problems by yourself. Installing a Windows VM may be
Read more