How to change the hostname on Linux Mint? The hostname (e.g. mypc or mypc.example.com) can be changed by putting the hostname in one line in the file /etc/hostname on Linux Mint.
Category: Tutorial
How to view a file at a specific commit in git?
Posted onHow to view a file at a specific commit/revision in git? You can use git show to view a file’s content at a specific commit in git: https://www.systutorials.com/docs/linux/man/1-git-show/ $ git show REVISION:/path/to/file You can also save a copy by $ git show REVISION:/path/to/file >file.copy
How to set the number of mappers and reducers of Hadoop in command line?
Posted onHow to set the number of mappers and reducers of Hadoop in command line? Number of mappers and reducers can be set like (5 mappers, 2 reducers): -D mapred.map.tasks=5 -D mapred.reduce.tasks=2 in the command line. In the code, one can configure JobConf variables. job.setNumMapTasks(5); // 5 mappers job.setNumReduceTasks(2); // 2 reducers Note that on Hadoop
Read more
How to import a googlecode git project to github project
Posted onI wanna migrate leveldb (code.google.com/p/leveldb) to my github repository. Create a new repo on github.com with this link https://help.github.com/articles/creating-a-new-repository git clone https://code.google.com/p/ project-name.git Set the remote origin url as follows: git remote set-url origin https://github.com/ username/ repo-name.git git pull to pull the latest. git push origin master after making local changes. This is the original
Read more
How to adjust the system partition (C:) size of Windows?
Posted onThe disk management tools of Windows can adjust it to some level. But there are more space available as far as I can tell. How to further adjust the system partition (C:) size of Windows? You may check these tools: EASEUS Partition Master (free) Includes Partition Manager, Disk & Partition Copy Wizard and Partition Recovery
Read more
How to jailbreak iOS 7.1.2?
Posted onHow to jailbreak iOS 7.1.2 on a iPhone 4s? The Pangu Jailbreak Tool ( http://en.pangu.io/ ) works like a charm for my iPhone 4S with iOS 7.1.2. Remember to back up your data before jailbreaking your iPhone.
x86-64 instructions for floating-point comparisons
Posted onWhat are the x86-64 instructions for floating-point comparisons like the cmpq for quard-word integer comparison? The SSE3 extenstions provide two instructions for comparing floating values: Instruction Based on Description ucomiss S2, S1 S1 – S2 Compare single precision ucomisd S2, S1 S1 – S2 Compare double precision As with cmpq, they follow the GAS convention
Read more
Fix the Grub issue with Windows 8 UEFI after installing Fedora 20
Posted onGrub fails to boot with Windows 8 UEFI after installing Fedora 20. The Grub entry for Windows 8 is: menuentry ‘Windows Boot Manager’ { chainloader /EFI/Microsoft/Boot/bootmgfw.efi boot } How to fix it? The set root= is missing. You probably can fix this by specifying the root manually: menuentry ‘Windows Boot Manager’ { insmod part_gpt set
Read more
How to find which hard drives a LVM volume uses?
Posted onHow to find which hard drives a LVM volume uses to decide which volume will be affected if a disk failes. You can use lvdisplay with the –maps option to display the the mapping of logical extents to physical volumes and physical extents: # lvdisplay –maps To map physical extents to logical extents, use #
Read more
How to erase disk partitions on U disks on Windows?
Posted onHow to erase disk partitions on U disks on Windows? Check the HDD LLF low level format tool: http://hddguru.com/software/HDD-LLF-Low-Level-Format-Tool/ It is free for personal usage. Run it as Adminiatrator and you can choose to erase partitions and MBR on the U disks. Be careful that the operation is is recoverable.
How to download a youtube video to my computer?
Posted onHow to download a youtube video to my computer? You may use the ClipConverter.cc for downloading Youtube videos: http://www.clipconverter.cc/ How to download a YouTube video: Paste your YouTube URL at ‘Media URL’ and press Continue. Select the format and the options for the conversion. The default options are for most videos a good setting. Press
Read more
Video player for iPhone for uploading video files and watching them
Posted onWhich video player for iPhone is good for uploading video files from my computer and watching them? For example, I download some video files and would like to watch them on my iPhone on the go. I know iTune can do this. But I am on Linux and I want something easier. Many apps can
Read more
Replacing with a string with newline in Emacs?
Posted onHow to replacing a string with another string with newline in Emacs? For example, to replace: good editor with good editor: Emacs What you need is actually to input a newline in Emacs: C-q C-j C-q is for quoted-insert, and C-j is a newline (0xa).
Emacs Remembering Last Editing Positions
Posted onHow to make emacs remember last editing positions in files. It will be convenient next time I open the same file the cursor automatically moves to the position I was last time editing the same file. The behavior seems enabled by default in Vim. How to make Emacs do this? I use the saveplace mode.
Read more
Setting up a VPN over SSH
Posted onSSH tunnel and port forwarding is great and convenient to use. But is it possible to set up a VPN like connection over SSH? If you are on Linux or Mac, you can use sshuttle: https://github.com/apenwarr/sshuttle If you are on Windows, you can use ProxyCap: http://www.proxycap.com/index.html Both are great software.
Enlarging Linux UDP buffer size
Posted onOne of the most common causes of UDP data gram lost on Linux is an undersized receive buffer on the Linux socket. How to enlarge Linux UDP buffer size? On Linux, you can change the UDP buffer size (e.g. to 26214400) by (as root): sysctl -w net.core.rmem_max=26214400 The default buffer size on Linux is 131071.
Read more
How to embed mp4 video in HTML pages?
Posted onI have a mp4 video file. How to embed it video in HTML pages? I use this piece of code: In HTML: <video class=”movie” src=”path/to/file.mp4″ controls></video> The CSS for “movie” class: .movie { max-width:1000px; } Here is one example.
How to mark a line as deleted in BBCode?
Posted onHow to mark a line as deleted in BBCode? e.g. a line crossing through the text. You can use the [s] tag. The BBCode: [s]strikethrough text[/s] will be converted <s>strikethrough text</s>, <del>strikethrough text</del> or <span style=”text-decoration: line-through;”>strikethrough text</span> Check more at: http://en.wikipedia.org/wiki/BBCode
fclose Q2A theme
Posted onCan I get the fclose Q2A theme used here? I’d like to share it but I also want to keep my site a little bit unique. What about this: you can get the css and qa-theme.php files, but need to find or design your own icons for the site (I believe some icons from other
Read more
Filter away non-printable ASCII characters on Linux?
Posted onSometimes the commands’ output have some non-printable ASCII characters. How to filter away these non-printable ASCII characters on Linux? You can consider the problem as “how to leave only printable ascii characters?”. The printable characters in ASCII table are: Octal 011: Tab Octal 012: Line Feed Octal 015: Carriage Return Octal 040 to 176: printable
Read more