Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- linux



  Integer overflow

You may be familiar with integer overflow, but what you may not be familiar with is how gcc handles signed integer overflow. First let's look at the standard, for unsigned integer, the standard says : A computation involving unsigned operands can never overflow, because a result that cannot be represented by the resulting unsigned integer type is reduced modulo the number that is one greater than the largest value that can be represented by the resulting type. In other words, unsigned integer ov...

   Integer overflow,gcc,Linux     2012-10-20 13:33:10

  How to find which process a file is being written by in Linux?

Some people ask a file is being written by one process and they want to check this process, but they cannot find the process even with sof. This question is very common and there are many solutions, here we introduce a straightforward method. In Linux, each file will be stored on one device and of course there will be a relative inode, then we can use vfs.write to know who is writing the inode on one specified device continuously. Luckily there is inodewatch.stp in the installation package of s...

   Linux,process,file write     2013-03-16 21:44:35

  Some useful Linux commands for teamwork

A small development team in the intranet will frequently transfer codes, share files. Here are some command we use frequently to release some of our work. They are not applicable to Windows users. 1. Output program execution output through GTalk. Sometimes we may need to send the program execution result and log to teammates for debugging using IM. These outputs are very troublesome to copy and send while in command line mode. So we could have a program called gpipe.py which can put GTalk as a p...

   Linux,NFS,GTalk,HTTP     2013-01-16 04:36:33

  The rather petite Internet of 1995

As you may know if you’re a regular reader of this blog, sometimes we like to take a trip down memory lane. It’s time for another one of those trips, to the murky past of the Internet and the dawning World Wide Web of 1995.Let’s start first with the people who actually use the Internet. How many were there back then?Worldwide Internet users in 1995Today there are almost 2 billion Internet users worldwide. In 2000, there were 361 million worldwide. But go back even farther in...

   Internet,Web,1995,Netscape,Microsoft,Net     2011-05-27 12:50:46

  One reason why mcrypt responds slowly

This morning one colleague came over and talked about one script which used mcrypt responded very slowly, the server configurations are fine. But the reason for the slowness is unknown. Here is one script which reproduces the issue: <?php $dmcryptText = "dummy"; $key = "foobar"; $size = mcrypt_get_iv_size(MCRYPT_BLOWFISH,MCRYPT_MODE_ECB); $iv = mcrypt_create_iv($size); //Take care $m = mcrypt_ecb(MCRYPT_BLOWFISH, $key, $dmcryptText, MCRYPT_DECRYPT, $iv); var_dump($m); When 20 requests of&...

   SOLUTION,SLOW,MCRYPT,RESPONSE,PHP     2012-09-27 12:03:16

  How to forcibly eject a CD/DVD from a MacBook Air USB SuperDrive

So you've got a DVD stuck in the external USB SuperDrive that connects to the MacBook Air? And you've tried hitting the magic Eject button on the keyboard to no avail?And you've tried drutil tray eject at the command-line? And you've tried booting with Option held down and clicking eject? And you've tried plugging the drive into other machines (Macs, Windows PCs, Linux machines) to no avail?What do you do?Clearly you hit the physical eject button, right? Every DVD drive has one of those. On the ...

   Apple,Macbook,USB Drive,Ejection     2011-11-17 08:39:56

  Haxe: Another multiplatform language

There are two kinds of programmers: One is using different languages to solve problems, the other is inventing languages to solve problems. Haxe is an emerging open source programming language which is universal, powerful and easy-to-use. Some languages claimed they were multiplatform languages, such as Java, C# and ActionScript. They all are based on some platforms, Java has JVM, C# has .Net and ActionScript has Flash Player. While Haxe is a trule multiplatform language, it can be used to devel...

   Haxe,Multiplatform,Open source     2012-06-11 08:08:28

  Difference between localhost and 127.0.0.1

Lots of people would think what the address 127.0.0.1 is when first seeing this address. In fact, 127.0.0.1 is a loopback address which refers to the local machine. It is generally used for local testing. When typing ping 127.0.0.1 on local command console, it will send network packets to local IP/TCP layer to test whether IP/TCP works properly or not.  To those who are used to use localhost, it is actually mapped to 127.0.0.1 by default. There are hosts files in the system which store this...

   LINUX,NETWORK,LOCALHOST,127.0.0.1,LOCALHOST VS 127.0.0.1     2018-09-29 22:11:12

  Top 10 PHP Best Security Practices for Sys Admins

PHP is widely used for various of web development. However, misconfigured server-side scripting would create all sorts of problem. And here are php security best practices that you should aware when configuring PHP securely. Nowadays most of the web servers are operated under Linux environment (like: Ubuntu, Debian...etc). Hence, in the following article, I am going to use list top 10 ways to enhance PHP Security Best Practices under Linux environment. My sample setup for PHP Security Tips: D...

   PHP,code security,System admin,Advice,Best practice     2012-02-01 00:04:37

  Shell script common interview questions

Shell script is frequently used when monitoring system status on Linux. It's not an easy task to write shell script but it's a very important skill for developers and system administrators to ease work and automate common tasks. This post will share some common interview questions about shell script. 1. Get random characters(8 characters) Method 1 # echo $RANDOM |md5sum |cut -c 1-8 471b94f2 Method 2 # openssl rand -base64 4 vg3BEg== Method 3 # cat /proc/sys/kernel/random/uuid |cut -c 1-8 ed...

   LINUX,INTERVIEW,SHELL SCRIPT     2018-09-28 10:46:00