Denny Labs

De Web Monster

ADB server didn’t ACK * failed to start deamon*

Are you encountering the following errors with ADB? Windows Command Prompt c:androidsdkplatform-tools>adb devices adb server is out of date. killing... ADB server didn't ACK * failed to start daemon * error: unknown host service Solution: ADB server cannot start if port 5037 was occupied by other process hence we need to find and kill the process to release this port. c:androidsdkplatform-tools>netstat -aon|findstr 5037 TCP 127.0.0.1:5037 0.0.0.0:0 LISTENING 6889 TCP 127.0.0.1:5037 127.0.0.1:50506 TIME_WAIT 0 TCP 127.0.0.1:5037 127.0.0.1:50507 TIME_WAIT 0 PID 6889 is occupying port 5037. Find the process and kill it. 2. Start ADB server c:androidsdkplatform-tools>adb start-server * daemon not running. starting it now on port 5037 * * daemon started successfully... read more

Installing Pure-FTPd on Ubuntu 12.04

Guide wrote on 13 Jan 2014 Step 1) Install Pure-FTPd using aptitude package tool root@server:~# aptitude -y install pure-ftpd Step 2) Run pure-ftpd as a daemon (background process) root@server:~# echo "yes" > /etc/pure-ftpd/conf/Daemonize Step 3) Disable anonymous ftp login root@server:~# echo "yes" > /etc/pure-ftpd/conf/NoAnonymous Step 4) Jail all local user to their home directories root@server:~# echo "yes" > /etc/pure-ftpd/conf/ChrootEveryone Step 5) Configure FTP server to use IPv4 only root@server:~# echo "yes" > /etc/pure-ftpd/conf/IPV4Only Last Step) Restart pure-FTP server for changes to take effect root@server:~# service pure-ftpd restart Optional configurations you may need: Defining passive ports (passive port range 21000 to 21100 in example below) root@server:~# echo "21000 21100" > /etc/pure-ftpd/conf/PassivePortRange Set maximum number of clients (50 clients in example below) root@server:~# echo "50" >... read more

Ubuntu Changing Hostname

Need to change your hostname? Use the following command. # sudo hostname <new-hostname> Now edit /etc/hosts and change the line starting with “127.0.1.1”. # sudo nano /etc/hosts 127.0.1.1 old-hostname <- replace this line to your new-hostname Now reboot your server, for new host name to take effect. # sudo... read more

Ubuntu Create New User Account

Command line for creating new user account in Ubuntu. Create a user with a standard home directory in the /home folder and specifying the default shell. # sudo useradd <username> -m -s /bin/bash Create a password for the user # sudo passwd <username> Grant administrator privilege to user # sudo adduser <username>... read more

Fail2ban – remove banned ip address from iptables

Your colleagues were trying to access production server via FTP. However exceeded the maximum number of failed logins, their IP address got blacklisted on iptables. How do you remove their ip address from the blacklist? Check their ip address with iptables # sudo iptables -L ... Chain fail2ban-vsftpd (1 references) target prot opt source destination DROP all -- 192.168.1.156 anywhere RETURN all -- anywhere anywhere Remove ip address from iptables # sudo iptables -D fail2ban-vsftpd -s 192.168.1.156 -j DROP Verify the iptables # sudo iptables -L ... Chain fail2ban-vsftpd (1 references) target prot opt source destination RETURN all -- anywhere... read more

Creating Symbolic Link (Ubuntu/Linux)

What is Symbolic Link? Creates a link to a file or directory in linux or unix operating system. Real world example Your developer are jail to their home folder for SSH connection. How to allow access to the code while enabling testing on the server? Create a symbolic link from user home directory to Apache web root directory. Syntax # ln -s <real file or directory> <virtual file or folder> Creating symbolic link for directory Assuming user denny home directory at /home/denny and apache web root document path at /var/www You will need root access to create symbolic link. # sudo mkdir /home/denny/someproject # sudo chown denny:developer /home/denny/someproject # sudo ln -s /home/denny/someproject /var/www # ls -ltr /var/www total 8 -rw-r--r-- 1 root root 177 Sep 16 22:56 index.html lrwxrwxrwx 1 root root 20 Oct 7 16:50 someproject -> /home/denny/someproject/ Creating symbolic link for file # sudo touch /home/denny/realfile # sudo chown denny:developer /home/denny/realfile # sudo ln -s /home/denny/realfile /var/www/realfile # ls -ltr /var/www total 8 -rw-r--r-- 1 root root 177 Sep 16 22:56 index.html lrwxrwxrwx 1 root root 20 Oct 7 16:50 someproject -> /home/denny/someproject/ lrwxrwxrwx 1 root root 20 Oct 7 16:54 realfile -> /home/denny/realfile To delete symbolic link Issue the rm (remove) command # rm /var/www/someproject # rm... read more