In Python, `os.makedirs()` with 0777 mode does not give others write permission

Posted on

In Python, os.makedirs() with 0777 mode can not give others write permission The code is as follows $ python Python 2.7.5 (default, Aug 4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2 Type “help”, “copyright”, “credits” or “license” for more information. >>> import os >>> os.makedirs(“/tmp/test1/test2”, 0777) >>> The created dirs are not
Read more

Cannot make directory ‘/var/run/screen/S-apache’: Permission denied

Posted on

Hello! Im trying to create a screen folder for the user apache, Not root. But it seems to fail, I have no idea on how to fix this issue. I only get the error: Cannot make directory ‘/var/run/screen/S-apache’: Permission denied Im using Cent OS 7 There may be various possible reasons. 2 common reasons: screen
Read more

How to get the one character’s next character in ASCII table in Bash?

Posted on

How to get the one character’s next character in ASCII table in Bash? For example, if I have ‘a’ in variable i, how to get ‘b’? First, we need to get the integer value for the character. char=’b’ charint=$(printf “%d” “‘$char'”) Then, we increase the integer by one let charint=$charint+1 Last, we can get the
Read more

Ubuntu’s GUI response is very slow

Posted on

For Dell PowerEdge T630 server, if you install latest Ubuntu desktop version (16.04) or (14.04), you will get a very slow GUI (X-window). $ inxi -G Graphics: Card: Matrox Systems G200eR2 X.org: 1.15.1 driver: vesa tty size: 205×58 Advanced Data: N/A out of X For Ubuntu 14.04.1, this problem can be solved by following steps.
Read more

How to use the xargs argument twice in the command on Linux?

Posted on

`xargs` passes the argument once to the utility command specified. For example, xargs cat will cat every line passed to xargs. But how to use the xargs argument twice in the command on Linux? For example, to rename file to file.bak where file is from the stdin. One solution is to write a small script like
Read more

How to enable SSH service on Fedora Linux?

Posted on

How to enable SSH service on Fedora Linux? By default, it seems ssh is not enabled. Fedora may not have sshd service installed/enabled by default. You will need to install and configure it by yourself. The following instructions is for Fedora 22 as an example. First, install the sshd server by # dnf install openssh-server
Read more

How to change the display manager on Fedora Linux?

Posted on

The default display manager on my Fedora 22 is gdm. If I would like to change it to other display manager like KDM, LightDM or other, which is the portable and reliable method? You can use the “system-switch-displaymanager” tools to manage the display manager. This is possibly the most portable way. To install it: #
Read more

How to make Fedora Linux not clean some files in /tmp/?

Posted on

On my Fedora 20, I find that the system automatically clean up file under /tmp/. This is convenient. However, it cause some problems for some programs. For example, HDFS puts its DataNode pid file under /tmp/ by default like hadoop-hadoop-datanode.pid. After it is cleaned up, the hadoop-daemon.sh script will consider there is no DataNode running.
Read more

How to make AdSense responsive ads show rectangle ads instead of horizontal ones?

Posted on

I noticed that many sites with AdSense responsive ads show large rectangle ads (336px x 280px) or large rectangle text ads (full width x 280px). However, in my own website (640px width content area), it shows most of time horizontal ones. How to make AdSense responsive ads show rectangle ads instead of horizontal ones? At
Read more

I cannot login Ubuntu Precise desktop

Posted on

I cannot login desktop in Ubuntu Precise. It told me following errors: Could not write bytes: Broken Pipe… Check Battery Satte Actually, I tried many ways to solve this problem. It seems that something wrong with my lightdm software so, at last, I use gdm software to replace lightdm to kill this problem. Just install
Read more

Any good Web browser in command line in Linux?

Posted on

What suggested web browser in command line? This will be very useful for browsing the Internet from a command line via SSH. You may use Lynx, a fully-featured World Wide Web (WWW) client for users running cursor-addressable, character-cell display devices, in Linux. Homepage: http://lynx.isc.org/ Lynx is a fully-featured World Wide Web (WWW) client for users
Read more

How to make CentOS 6.6 power off the console screen automatically?

Posted on

On CentOS 6.6, I find that it can make the screen (console, not X) blank after a while. However, it does not power the screen off. This usually work on Fedora or other releases. I guess this is caused by some configurations specific in CentOS 6.6. How to make CentOS 6.6 power off the console
Read more

How to upgrade packages installed by ELPA in Emacs?

Posted on

ELPA manages packages for Emacs nicely. But, how to upgrade packages installed by ELPA in Emacs? Within Emacs, list all packages by M-x list-packages and it will automatically refresh the archive contents. Then, press U to mark all upgradable packages to be upgraded. Last, press x to perform the new updates. Emacs will then download
Read more

How to install latest version of Calibre?

Posted on

How to install latest version of Calibre? The version from my distro (Ubuntu, Linux Mint, Fedora) seem at 1.xx while the latest Calibre is already at 2.x. You may check Caibre website’s instruction: http://calibre-ebook.com/download_linux sudo -v && wget -nv -O- https://raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py | sudo python -c “import sys; main=lambda:sys.stderr.write(‘Download failedn’); exec(sys.stdin.read()); main()”