Skip to content

SysTutorials

  • Tutorials
  • Linux
  • Linux Manuals
  • Systems
  • Programming
  • Software
  • Subscribe
  • Search
SysTutorials

  • QA

    How to calculate the average of value in lines of a text file on Linux by a script?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    How 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 How to calculate the average of value in lines of a text file on Linux by a script?Continue

  • QA

    How to get the time at millisecond level on Linux with command line?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    I 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

    Read More How to get the time at millisecond level on Linux with command line?Continue

  • QA

    How to package a Scala project to a .jar with sbt?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    How 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 package a Scala project to a .jar with sbt?Continue

  • QA

    How to install multiple versions of sbt on my Linux host?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    How 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 install multiple versions of sbt on my Linux host?Continue

  • QA

    How to Import a CMake project into Eclipse CDT?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    How 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.

    Read More How to Import a CMake project into Eclipse CDT?Continue

  • QA

    How to get the file length in C on Linux

    ByEric Ma Mar 24, 2018Mar 24, 2018

    How 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; }

    Read More How to get the file length in C on LinuxContinue

  • QA

    How to catch the kill signals sent by kill in C on Linux?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    How 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 catch the kill signals sent by kill in C on Linux?Continue

  • QA

    Git branching tutorial

    ByEric Ma Mar 24, 2018Mar 24, 2018

    Good 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

    Read More Git branching tutorialContinue

  • QA

    How to force yum not to update certain packages?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    How 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 How to force yum not to update certain packages?Continue

  • QA

    How to Wrap and NOT Wrap Lines in vim

    ByEric Ma Mar 24, 2018Mar 24, 2018

    How 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

    Read More How to Wrap and NOT Wrap Lines in vimContinue

  • QA

    How to make thunderbird not wrap lines automatically?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    How to make thunderbird not wrap lines automatically? Check Making Thunderbird Not Wrap Lines Automatically: Setting mail.compose.wrap_to_window_width to true.

    Read More How to make thunderbird not wrap lines automatically?Continue

  • QA

    Formatting code shortcuts in Eclipse

    ByEric Ma Mar 24, 2018Mar 24, 2018

    Formatting code shortcuts in Eclipse. Shortcut: Ctrl + Shift + F No need to select the code.

    Read More Formatting code shortcuts in EclipseContinue

  • QA

    Add my own window.onload safely without overwriting old ones

    ByEric Ma Mar 24, 2018Mar 24, 2018

    My 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 Add my own window.onload safely without overwriting old onesContinue

  • QA

    Running Chrome over SSH tunnel

    ByEric Ma Mar 24, 2018Mar 24, 2018

    How 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 Running Chrome over SSH tunnelContinue

  • QA

    Emacs highlighting part of lines that go over 80 chars

    ByEric Ma Mar 24, 2018Mar 24, 2018

    How 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

    Read More Emacs highlighting part of lines that go over 80 charsContinue

  • QA

    How to force ibus to restart in Gnome 3?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    How 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 How to force ibus to restart in Gnome 3?Continue

  • QA

    Changing a git commit message after I have pushed it to the server?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    How to change a wrong git commit message after I have pushed it to the server? If the remote repository is shared with others, it is better to let the wrong git commit message there. If you use the repository by your own and you are sure that no one else has pulled your latest…

    Read More Changing a git commit message after I have pushed it to the server?Continue

  • QA

    Printing a file in hexadecimal format of all content on Linux?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    How to print a binary file in hexadecimal format of all content? Use xxd: xxd file.txt or xxd -p file.txt

    Read More Printing a file in hexadecimal format of all content on Linux?Continue

  • QA

    How to install IE under wine on Linux?

    ByEric Ma Mar 24, 2018Mar 24, 2018

    How 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 How to install IE under wine on Linux?Continue

  • QA

    Replacing tabs with spaces in Emacs

    ByEric Ma Mar 24, 2018Mar 24, 2018

    How to replace tabs with spaces in Emacs? You can first select the regions of text for converting/replacing, then run M-x untabify to replace all tabs with appropriate number of spaces. There is also a M-x tabify for replacing sequences of spaces to tabs. There are also commands to convert tabs to spaces or vice…

    Read More Replacing tabs with spaces in EmacsContinue

Page navigation

Previous PagePrevious 1 … 34 35 36 37 38 … 70 Next PageNext

© 2026 SysTutorials

  • Tutorials
  • Linux
  • Linux Manuals
  • Systems
  • Programming
  • Software
  • Subscribe
  • Search