How to Send Email Using mailx/s-nail in Linux Through Internal SMTP

Posted on

How to Send Email from mailx Command in Linux Using Gmail’s SMTP introduces how to send email using heirloom mailx (or s-nail if you are using Ubuntu 18 or later or similar releases) command in Linux through Gmail’s SMTP which requires some configuration. On the other hand, there are many environments that do not require
Read more

Linux UDP Programming Tutorial

Posted on

UDP has its advantages over TCP, such as being relatively lightweight and receiving one packet per read call (recvmsg), although the programmers need to handle related issues, such as packet lost and out-of-order packets delivery. This post gives information and references on how to write UDP programs in a C/Linux environment. What is UDP Check
Read more

How to Measure Time Accurately in Programs

Posted on

It is quite common to measure the time in programs using APIs like clock() and gettimeofday(). We may also want to measure the time “accurately” for certain purposes, such as measuring a small piece of code’s execution time for performance analysis, or measuring the time in time-sensitive game software. It is hard to measure the
Read more

Favorite Sayings by John Ousterhout – Precious Experience and Advice for Building Systems

Posted on

John Ousterhout is a professor of Deparment of Computer Science from Stanford University. One recent project he is working on is the RAMCloud, a “new class of storage, based entirely in DRAM, that is 2-3 orders of magnitude faster than existing storage systems”. He posts his “Favorite Sayings” on his homepage. These sayings are precious
Read more

Changing Linux User Password in One Command Line

Posted on

In Linux, we use passwd to change password, but passwd requires input from stdin to get the new password. It is common case that we may want to change the password non-interactively, such as creating new user accounts and change or set password for these accounts on a number of Linux boxes when the new
Read more

How to Configure iOS to Use Socks Proxy over SSH with a Linux/Unix Host

Posted on

The socks proxy I created following Proxy Using SSH Tunnel works very well on both Linux and Windows. However, when I try to configure my iPhone and iPad with iOS, I find iOS does not support socks proxy in its settings interface. I don’t know why it is not added while socks proxy is indeed
Read more

How to Copy Output of Commands in a Linux Terminal to X Selection or Clipboard

Posted on

xclip is a tool to copy the copy the output of commands from a command line in a terminal to X selection or clipboard. It connects the command line interface and the X selections (clipboard) and is a very useful tool. For example, processing some text in vim in a terminal and then copying it
Read more

How to Change MediaWiki’s Sidebar

Posted on

MediaWiki’s Sidebar can be configured as a special page. This page’s title is “MediaWiki:Sidebar”. For example, if a MediaWiki site www.example.com is configured to use [[search-engine-friendly-url-for-mediawiki]], the URL for edit the Sidebar is: http://www.example.com/w/MediaWiki:Sidebar It may look like this: * navigation ** mainpage|mainpage-description ** recentchanges-url|recentchanges ** randompage-url|randompage ** currentevents-url|currentevents ** portal-url|portal ** helppage|help * SEARCH
Read more

Search Engine Friendly URL for MediaWiki

Posted on

MediaWiki is the wiki-engine that runs Wikipedia. In this tutorial, we introduce how to configure search engine friendly URLs in MediaWiki. ==Search Engine Friendly URLs== Default MediaWiki URLs look like www.example.com/w/index.php?title=TITLE which is a little ugly. To make it more search engine friendly, we will change it to SEO-friendly URLs like www.example.com/w/TITLE. ==Enabling Search Engine
Read more

How To Mount Google Drive on Linux

Posted on

Google Drive is nice cloud storage which provide document editing features. However, it does not yet provide a Linux client. I find a good third party tool that works with Google Drive on Linux very well: google-drive-ocamlfuse. The website of google-drive-ocamlfuse provides easy to follow instructions to install it. In this tutorial, we show a
Read more

ASCII Table and ASCII Code

Posted on

This post gives the ASCII table and ASCII code with ASCII control characters and ASCII printable characters and a tool to convert ASCII codes to ASCII characters. Introduction to ASCII table and ASCII code ASCII stands for American Standard Code for Information Interchange. An ASCII code is the numerical representation of a character since computers
Read more

C++ Reference and Styles

Posted on

C++ References Reference of the C++ Language Library, with detailed descriptions of its elements and examples on how to use its functions: http://www.cplusplus.com/reference/ C++ reference: http://www.cppreference.com/w/ C++ Styles I compile a list of C++ styles on the Internet. http://geosoft.no/development/cppstyle.html http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml http://www.mactech.com/articles/develop/issue_02/C%2B%2B_Style_Guide_v007.html http://www.cs.uga.edu/~dkl/1302/Fall99/style.html

Latex Cheat Sheet

Posted on

Latest has many commands and it is not easy to quickly remember them all. Then, a cheat sheet will be very useful. Here is a collection of cheat sheets for Latex that I collected from the Web. Latex cheat sheet Latex cheat sheet by Winston Chang: Download latex cheat sheet. LaTeX Math Symbols https://web.archive.org/web/20190707092927/http://web.ift.uib.no/Teori/KURS/WRK/TeX/symALL.html

HP Compaq BIOS Crisis Recovery from a Failed BIOS Flashing Using a USB Flash Disk

Posted on

I tried to flash my HP Compaq CQ35-240TX’s BIOS to F.15 but unfortunately failed. The computer turned to white screen. When I restarted (powered off then boot again), this is no response any more: the hard disk and caps lock’s LED keep blinding. I thought “Oh my God! I must send it to HP to
Read more

Makefile Tutorials

Posted on

Make is a utility that automatically builds executable programs and libraries from source code by reading files called makefiles which specify how to derive the target program. Make is widely used, especially in Unix/Linux world. More introductions to Make and it’s history can be found on Wikipedia. In this post, I list articles for Makefile
Read more

OCaml Learning Materials

Posted on

OCaml is an interesting functional language. There are lots learning materials on the Internet. I compile a list of resources for OCaml learning and reference. Recommended OCaml learning and reference material Online book of Real World OCaml by Yaron Minsky, Anil Madhavapeddy, Jason Hickey. A very good tutorial by Jason Hickey: http://www.cs.caltech.edu/courses/cs134/cs134b/book.pdf. The OCaml system
Read more

4 Ways of Converting String to Int in C++

Posted on

It is common to convert a string (std::string) to integer (int) in C++ programs. Because of the long history of C++ which has several versions with extended libraries and supports almost all C standard library functions, there are many ways to convert a string to int in C++. This post introduces how to convert a
Read more

MFC程序使用系统风格界面

Posted on

VC6默认编译出来的程序在XP下Luma风格下运行也是Windows的经典界面, 有损界面的美观与统一. VC2008默认设置下如果不是使用的unicode也是如此. 本文给出使VC6和VC2008可以编译出使用系统界面风格的解决方案. 1. 使VC6编译出使用系统风格的程序 步骤如下: 1) 创建一个.manifest文件的资源. 在res/文件夹下创建一个跟以程序名加.manifest的文件, 如果程序为test.exe, 则创建test.exe.manifest 文件可由此下载: https://www.systutorials.com/t/g/programming/resultcollector.manifest/ 注意要使用utf-8编码保存。 2) 将新定义的资源加入到.rc2文件中, 类型设为24. 打开res/文件夹下的.rc2文件, 在其中加入如下定义: 1 24 MOVEABLE PURE “res/test.exe.manifest” 其中的文件地址按1)步中修改的设置即可. 之后编译即可, 为了使程序界面可能充分利用系统的界面特性, 可以将界面字体设置为TrueType类型的, 利用Windows XP等系统的屏幕字体平滑特性. 2. 使VC2008编译出使用系统风格的程序 在VC2008下就比较简单了, 如果程序字符集使用unicode则默认就是使用系统界面风格的, 如果选择其它的类型, 则编辑下stdafx.h即可. 最后面部分找到这么一段: #ifdef _UNICODE #if defined _M_IX86 #pragma comment(linker,”/manifestdependency:”type=’win32′ name=’Microsoft.Windows.Common-Controls’ version=’6.0.0.0′ processorArchitecture=’x86′ publicKeyToken=’6595b64144ccf1df’ language=’*'””) #elif defined _M_IA64 #pragma comment(linker,”/manifestdependency:”type=’win32′
Read more