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

SEARCH KEYWORD -- /dev/tcp



  bash network interface

Some of us may have seen /dev/tcp/<host>/<port> before, is this a special file system implemented in some BSD kernel? Because there is no /dev/tcp in Linux. Actually, this one is implemented in bash. We no need to rely on wget,nc to do network connection. It's very easy to use this interface: bash-4.2$ cat </dev/tcp/time.nist.gov/13 56188 12-09-18 15:34:26 50 0 0 733.5 UTC(NIST) * bash-4.2$ exec 3<>/dev/tcp/www.w3.org/80 bash-4.2$ echo -e "GET / HTTP/1.0\n\n" >&3 b...

   Bash,Network interface,/dev/tcp     2013-07-20 00:57:52

  Check whether a remote server port is open on Linux

As a system administrator or network engineer or application developer, there is a need to check whether a port on remote server is open so that you can tell whether the service under check is running or not. In this post, we would cover a few methods to check whether a remote server port is open or not on Linux. telnet telnet is the most frequently used command on both Windows and Linux to check port. The simple usage for this command is  telnet [host] [port] When the port is open, the o...

   LINUX,TELNET,PORT,NC,NMAP     2017-12-23 11:45:20

  FTP active mode and passive mode

1. What's active mode and passive mode a. FTP has two ports to control: Port 20 is for data transfer Port 21 is for control or establish TCP connection b. The process of active connection Note: C represents Client and S represents Server S opens port 20 and 21 C connects to port 21 of S with a random port, this port can be between 1024 and 65536, it sends port+x to server at the same time to specify C(X)->S(21) When S receives the command, it will sends back ACK, S(21)->C(X) S will set ...

   FTP,Active mode,Passive mode     2013-04-01 07:01:25

  37 powerful Linux shell commands

To work on Linux platform, you cannot avoid using shell commands to complete some tasks. These tasks can be as simple as list files in some directories or find some text in some file, or can be as complex as monitoring processes. In this post, we will share 37 powerful Linux shell commands.   Task Commands 1 Delete file with 0 byte(empty file) find . -type f -size 0 -exec rm -rf {} \;find . type f -size 0 -delete 2 Check process memory consumption ps -e -o "%C : %p : %z : %a"|sort -k...

   Linux command,List     2013-09-16 07:47:16

  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

  WireGuard VPN Troubleshooting

When you are working as a network/cluster admin for you team to config the WireGuard VPN for other members, you may meet some of the problems below and these are the solution you can try to fix them. ----------------------------------------------------------------------------------------------------------- Problem [1]: The WireGuard handshake request send from the client can be received from the server but the server's response was blocked at some where so the client can not receive serv...

   WIREGUARD,VPN,TROUBLESHOOTING     2021-12-14 09:17:46

  /dev/null and /dev/tty in Linux

In Linux, there are two special files /dev/null and /dev/tty. /dev/null will drop all the data written to it, i.e, when program writes data to this file, it means the program has completed the data write operation. But in  fact it does nothing, if you just want the status of a command but not the output of a command, this feature will be very useful. See below shell codes:     /> vi test_dev_null.sh        #!/bin/bash    if grep...

   Linux,/dev/null,/dev/tty     2013-03-04 02:23:23

  How Do I Enable Remote Access To MySQL Database Server?

By default remote access to MySQL database server is disabled for security reasons. However, some time you need to provide remote access to database server from home or a web server. If you want to remotely access to the database server from the web server or home, follow this quick tutorial.MySQL Remote AccessYou need type the following commands which will allow remote connections.Step # 1: Login Using SSH (if server is outside your data center)First, login over ssh to remote MySQL database ser...

   MySQL,Remote access,Enable,Host or webdomain     2011-10-31 00:31:41

  UDP vs. TCP

Introduction Hi, I’m Glenn Fiedler and welcome to the first article in my online book Networking for Game Programmers In this article we start with the most basic aspect of network programming, sending and receiving data over the network. This is just the beginning – the simplest and most basic part of what network programmers do, but still it is quite intricate and non-obvious as to what the best course of action is. Take care because if you get this part wrong it will have ...

   Game design,Networking,Communication,TCP,UDP,Design     2012-02-27 04:49:53

  How to use Chome dev tool to find event handler bound to an element

As a front end developer, there is frequent need to debug JS code and sometimes need to find out what event handler has been bound to a HTML element. In this post, we will show how to find out the click event handler bound to a HTML element, this same applies to other events as well. Nowadays, a web application is usually very complicated and there are lots of JS codes which makes it difficult to find out what click event handler has been bound to a HTML element, especially when the JS source co...

   JAVASCRIPT,CHROME,CHROME DEV TOOL,EVENT LISTENER     2019-08-17 22:14:36