How to make a swap partition on Linux? First, make a new partition (or reuse an existing one if you like). I suggest using cfdisk to create it: https://www.systutorials.com/docs/linux/man/8-cfdisk/ Then, turn the new partition (say, /dev/sdc1) to a swap # mkswap /dev/sdc1 Lastly, turn it on # swapon /dev/sdc1 You can check whether its status
Read more
Category: QA
Questions and answers.
Setting Swap Priority in Linux
Posted onHow to set swap priority in Linux? Can I use 2 swap partition at the same time? You can set the priority of swap in Linux by swapon. For example, to set /dev/sdc1‘s priority to 0: # swapoff /dev/sdc1; swapon -p 0 /dev/sdc1 You can also put one entry into the /etc/fstab to make it
Read more
How to write a autostart script for gnome
Posted onI want to automatically run a program when I log in gnome. How to write a autorun script for it? Here is one example: $ cat ~/.config/autostart/dropbox.py.desktop [Desktop Entry] Comment[en_US]= Comment= Exec=/home/zma/bin/dropbox.py start GenericName[en_US]= GenericName= Icon=system-run MimeType= Name[en_US]= Name= Path= StartupNotify=true Terminal=false TerminalOptions= Type=Application X-DBUS-ServiceName= X-DBUS-StartupType= X-KDE-SubstituteUID=false X-KDE-Username= To set up a new one, you
Read more
How to make the video play in background in iPhone?
Posted onEach time I play a video and lock the iPhone by pushing the power button, the video is automatically stopped. If I want to play a MTV and just listen to the music when I walking, I’d like the video play in the background. Is there a method to make this happen? I can do
Read more
iPhone: capture a photo with the remote adapter on earphone
Posted onHow to capture a photo with the remote adapter? You can take a shot by taping the volume-up button of the remote adapter on the earphone. In this way, you can achieve supersteady shots using the earphones as a shutter release.
What does the /b/ mean in the URL of Fclose.com – SysTutorials QA
Posted onThere is a ‘/b/’ in the posts’ URLs on fclose.com . What does it mean? It originally means “blog” when the blogs are first set up. This site changes to not only a blog (one good example is this forum) over time. However, the URLs are kept unchanged and the ‘/b/’ has no special meanings
Read more
How to change the gnome keyring password?
Posted onI want to change the gnome keyring password. How to change it? You can change the keyring password in these steps (on gnome 3): Start seahorse $ seahorse Select “By keyring” in the “View” menu On the left side, right click the “Login keyring” item. You will find the “Change Password” option there. It will
Read more
Designing posters – SysTutorials QA
Posted onSome tutorials or materials for designing posters? Designing conference posters by Colin Purrington: http://colinpurrington.com/tips/academic/posterdesign Scribus – an open source desktop publishing tool: http://www.scribus.net/canvas/Scribus Inkscape is a good tool for editing vector figures. GIMP is a great tool for editing images.
Why is this site called Fclose? – SysTutorials QA
Posted onWhy is this site called Fclose? Actually, no special meaning at all. “fclose” is just a familiar function for ones that are familiar with computers.
Squeezing Space in LaTeX – SysTutorials QA
Posted onHow to squeeze space in Latex? A good tutorial about “squeezing space in LaTex” in here from the Cambridge University’s website: http://www.eng.cam.ac.uk/help/tpl/textprocessing/squeeze.html These settings work great for me: setlength{textfloatsep}{1pt} setlength{abovecaptionskip}{1pt} setlength{belowcaptionskip}{1pt} A more aggressive configuration to squeeze space in a LaTex doc: % save space usepackage{enumitem} setlist{nolistsep} % no space between refs usepackage{bibspacing} setlength{bibspacing}{baselineskip} usepackage[small,compact]{titlesec}
Read more
Free server images – SysTutorials QA
Posted onAny free server images? 24 Free Data Center Photos from fatcow.com 24 Free Data Center Photos: http://www.fatcow.com/data-center-photos From Wikimedia commons: Multiple servers: http://commons.wikimedia.org/wiki/File:Server-multiple.svg Server: http://commons.wikimedia.org/wiki/File:Server.svg Yellow server: http://commons.wikimedia.org/wiki/File:Server-yellow.svg Green server: http://commons.wikimedia.org/wiki/File:Server-green.svg More from clker.com: Web Virtualization Server clip art: http://www.clker.com/clipart-1826.html Small Case Web Mail Server clip art: http://www.clker.com/clipart-1902.html Inside our data centers from Google —
Read more
Printing Integers in Hexadecimal Format in Python
Posted onPrinting integers in hexadecimal format in Python is a simple task that can be accomplished using the built-in hex() function. By following the steps outlined in this post, you can easily print integers in hexadecimal format in Python. Additionally, by using string formatting, you can control the format of the hexadecimal output to suit your
Read more
How to disable all swaps on Linux
Posted onHow to disable all swaps on Linux to force the application/kernel use the physical memory? To diable all swaps on Linux, run this command as root: # swapoff -a -a means all swaps. Similarly, to enable all swaps on Linux: # swapon -a
Why setting up Fclose Questions?
Posted onReaders may ask “there are lots Q&A sites. Why do you set up ask.fclose.com?”. There are mainly two reasons: I have some tips to share which are short and fit into the Q&A model very well. These tips sometimes do not fit into a relative long blog post. Hence, I post them as Q&As. Some
Read more
x86-64 calling convention by gcc
Posted onWhat is the x86-64 calling convention by gcc? The calling convention of the System V AMD64 ABI is followed on GNU/Linux. The registers RDI, RSI, RDX, RCX, R8, and R9 are used for integer and memory address arguments and XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6 and XMM7 are used for floating point arguments. For
Read more
strcmp and strncmp implementation in glibc
Posted onWhat is the strcmp and strncmp implementation in glibc? strcmp implementation in glibc 2.16: string/strcmp.c /* Copyright (C) 1991, 1996, 1997, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU
Read more
Enabling Debugging with CMake for a C++ Project
Posted onWhen developing a C++ project, debugging is an essential part of the process, as it allows you to identify and fix issues in your code. If you’re using CMake to build your project, it’s crucial to know how to enable debug mode to take advantage of debugging tools like gdb. In this post, we’ll walk
Read more
How to get the size of a file in C
Posted onHow to get a file’s size in C? If you have the file stream (FILE * f): fseek(f, 0, SEEK_END); // seek to end of file size = ftell(f); // get current file pointer fseek(f, 0, SEEK_SET); // seek back to beginning of file // proceed with allocating memory and reading the file Or, #include
Read more
ANSI C Grammar and ANSI C Grammar Specification in YACC
Posted onANSI C is a standardized version of the C programming language that was introduced in 1989 by the American National Standards Institute (ANSI). The ANSI C standard defines the syntax and semantics of the C language, including its grammar. In this post, we will explore the ANSI C grammar in more detail. The ANSI C
Read more
scanf is dangerous, but what is the reason?
Posted onWe all know scanf / fscanf / sscanf is dangerous. But why? what is the exact reason? I thought the ‘%s’ is a problem that causes buffer overflow and ‘fgets’ is a better solution. But is it the exact reason? I pased a discussion by AndreyT and his discussion helps me figure it out: Claiming
Read more