Tanbir.NET

Tanbir Ahmed Official

June 6, 2013
by Tanbir A.

Basic Ubuntu Setup

To set up your new server, execute the following commands.

Set the hostname

Set the server hostname. Any name will do — just make it memorable. In this example, I chose “future”.

Let’s verify that it was set correctly:

Set the fully-qualified domain name

Set the FQDN of the server by making sure the following text is in the /etc/hosts file:

It is useful if you add an A record that points from some domain you control (in this case I used “future.<your domain>.net”) to your server IP address. This way, you can easily reference the IP address of your server when you SSH into it, like so:

If you’re curious, you can read more about the /etc/hosts file.

Set the time

Set the server timezone:

Verify that the date is correct:

Update the server

Check for updates and install:

June 6, 2013
by Tanbir A.

LNMP – Linux, NginX, MySQL, PHP

LNMP-debianvpsStep by step LNMP installation guide for CentOS, Ubuntu, Debian

Huge thanks to http://lnmp.org/

I have compiled few sites and tested to install LNMP in my vps, and it works perfectly. The sites will give you a clear idea about LNMP and its features. These will help you a lot.

Here are the Site links for Ref:

http://www.ruchirablog.com/nginx-autoinstaller/

http://dallascao.com/en/vps-step-by-step/

 

P.S: If you are looking for cloud hosting on hourly basis, starting from $0.007/hr or $5/month, check out: https://www.digitalocean.com/ I find them very cheap.

June 6, 2013
by Tanbir A.

How to build your own Linux PPTP VPN server, the easiest way

Some people suggest that maybe you should try to build your own vpn server yourself! Indeed it’s not rocket science but still it needs someone to show you the rope. I am not going to be very detailed in each step but you can research them separately.

First you have to get yourself a Xen VPS, not openVZ, although few openVZ provider supports PPTP VPN. I am using a openvz vps from buyvm.net. They do support pptpd, so i am all good to go. I am using linux CentOS in it.

Install PPTP server application on your VPS:

remote_command_line

Type at the command line:

And press enter
Then type at the command line:

to run the script.

PPTP server application will be installed on your VPS. At the end of the installation, the script will create an VPN account for you (a username and a password).

That’s it. You now get your own VPN account on your own server! Now you can use the username and password and the IP of your server to log on. Of course you will need to do a simple set up on your Windows or iPad or Android phone like with a VPN account you get from a VPN service provider.

Create more VPN accounts for your friends!

You want to impress your friends by creating a VPN account on your server for them too!

It’s easy to add VPN accounts. Just edit a file “/etc/ppp/chap-secrets” on your folder. Wait.. how do you do that? You easiest way for people who are unfamiliar with linux is perhaps using FTP!

1. Download and install FileZilla (FTP client software).
2. Click “site manager” (the first button on the tool bar) and click add site
For Host field: type your server IP.
For Protocol: choose SFTP
For Login type: choose General
Then input your SSH account (not your VPN account!,the one that you VPS provider gives you) . The user name is usually “root”.
3. Click “Connect” and then you open your sever.
Go to /etc/ppp/ and then download the file “chap-secrets”. Edit that file with notepad and add a line:

4. Save the file and upload to the server to replace the old file.

Last but not least, you need to use you SSH account to log on your server command line using Putty again (like in step two) and then type:

For your new account to take effect.

June 1, 2013
by Tanbir A.

How to install htop in CentOS easily via yum

image35

htop

htop is an interactive process viewer for Linux, which is a powerful alternative to the start ‘top’ utility. Some of the benefits of htop:

  • Supports mouse interactions
  • Better sorting and selective display
  • Color formatted display
  • Resource graphs
  • Process treeview

Installing htop

To install htop to Redhat or CentOS (5.X) Linux easily via the yum package manager, the rpmforge package repository must be installed. To install, retrieve, and install the following RPM for your architecture (32bit or 64bit).

32-BIT

64-BIT

Now that the rpmforge repository is installed, you can install the htop package easily via yum.

Thanks to hosting.com for the tut. I find it very useful.

Also check out How to use htop in linux.

April 17, 2013
by Tanbir A.

Pear OS 7 the Mac of Linux

home_warp_teaser

If you like the look of macOS this linux os will sure get you going for free. Its called Pear OS or Pear Linux. Its linux ubuntu based OS.

Efficient, modern and free…What’s else ?

Features: http://pearlinux.fr/discover/

Pear OS 7 is easy to use

And it comes with thousands of free applications. Pear OS 7 does everything you need it to. It’ll work with your existing PC files, printers, cameras and MP3 players.

You will find in this version :

– Kernel 3.5
– LibreOffice 4.0.1
– Pear OS Software Center
– MyPear 4
– Pear Cleaner 2.1
– Pear PPA Manager
– On Air
– VLC Media PLayer
– Firefox
– Back Time (Clone of Apple Time Machine)
– Geary Mail
– Adobe Flash Player (updated)
– Shotwell
– Empathy
– Brasero
– Cheese
– Notification Center

Based on ubuntu 12.10 without Unity and the GNOME panel; new Pear Linux Shell (7.0) based on Wingpanel and plank; new Pear Linux theme and new icon theme; it is now faster and uses fewer resources; new boot splash and login screen; new desktop notifications with Notification Center; new Pear OS Software Center; new Mission Control; new Virtual Desktop Switcher; Based on Kernel 3.5.0-23 but you could install with corella-kernel repository the kernel 3.7.10 and kernel 3.8.5. New software with CleanMyPear : a cleaning system ; New version of MyPear 4 : customize your system ; PPA Manager : Add pap source easily : New About this computer will show info about your computer ; New Audio Player On Air : fork of Noise player : Back In time : a clone of Apple Time Machine ; Geary Mail : LibreOffice 4.0.1…

Pear OS 7 available for download

http://pearlinux.fr/pear-os-7-available-to-download/

 

April 17, 2013
by Tanbir A.

MyBB useful SQL Query List

mybb sql

Reset admin usergroup post count to zero (Assuming the admins group ID is “4”):

To force the Classic Postbit (requires template changes to remove option to change again):

To force the Horizontal Postbit (requires template changes to remove option to change again):

To set a lost/forgotten password to ‘test’ for a user (requires you to change X to the uid of the user this will apply to):

To put you back into the Admin usergroup if you get changed to a different group (Assuming that the admins user ID is “1”):

Turn off thread ratings in all forums (requires you to also rebuild the ‘forums’ cache in the ACP):

Turn on thread ratings in all forums (requires you to also rebuild the ‘forums’ cache in the ACP):

Make all invisible people visible (requires template changes to remove option to change again):

Continue Reading →

April 16, 2013
by Tanbir A.

PPTP VPN server setup guide for Debian OpenVZ VPS

linux-1So recently I was searching on google on how to setup a PPTP VPN server in linux, specially in Debian OpenVZ VPS. I own few low end vps from BuyVM and Ramnode. Both are 128MB vps and allowed TUN/TAP and PPP.

After some search i got few sites that actually has the perfect guide of OpenVZ vps. This will help you a lot. I have personally tested on both of my openvz vps and successfully able to connect pptp vpn from my Android phone and windows 7. Works great.

These are following sites that will help you create a PPTP vpn server in Debian / Ubuntu.

http://www.putdispenserhere.com/pptp-vpn-setup-guide-for-a-debian-openvz-vps/ (Tested & Recommended)

http://malachisoord.com/blog/post/2013/01/28/setup-pptp-vpn-on-debian-openvz-vps

There is also a script that will automatically setup PPTP/PoPToP on your OpenVZ VPS in a few of minutes. Port forwarding, server configuration, and authentication setup is all taken care of for you.

http://www.putdispenserhere.com/pptp-debian-ubuntu-openvz-setup-script/ (Tested & Recommended)

For troubleshooting this link helped me:

http://www.lowendtalk.com/discussion/2305/pptp-vpn-on-ubuntu-10.04-wont-connect

 

April 11, 2013
by Tanbir A.

Security precautions before you start using PHP on your Apache server

Introduction – what is PHP?

PHP is a server side scripting language. You can embed PHP code in your web pages along with HTML. When your server receives a request for a page, it first gives the page to the PHP handler program. The PHP handler outputs HTML code as-is, but when it encounters PHP commands, it executes them. Any HTML generated by the PHP commands is also output. The end result is a web page with content that has been customized on the server before being sent to whoever requested it.
PHP has capabilities that make it a potential security risk:

  • It can receive and process data from the “outside world”
  • It can be programmed to actively fetch data from anywhere on the internet
  • It is able to read and write files on the server

If you have a website, you can expect to be under constant attack from robots attempting to a) “send in” malicious data and scripts from the outside world, b) trick your server into fetching malicious scripts and running them, c) read and write files on your server. Their goal is to take control of your site and use it for their own purposes.
This article gives configuration settings for PHP and rules for PHP coding that are effective at blocking the most common types of attacks. The configuration lines are few and the rules are simple.
There are two files where PHP configuration commands can go: php.ini or Apache .htaccess.
You should use php.ini as your first choice, if you can. You should be able to use it if:

  • You are on shared hosting at a webhost that uses suPHP or any other configuration that allows individual users to create their own php.ini files. If in doubt, ask them.
  • You are on dedicated hosting (your own rented server), or
  • You host your own website on your own server.

1a) Configure PHP settings with a php.ini file 

php.ini specifies the configuration settings PHP will use when it is running on your website. It determines what things PHP scripts are allowed to do and what they are prohibited from doing. The following settings affect security.
In your public_html (the same folder where your site’s main home page is), create a text file called php.ini that contains these lines. Instructions for customizing the text shown in red are farther down this page:
Continue Reading →

April 11, 2013
by Tanbir A.

Server Shield v1.1.5 – Protect and Harden your Linux server in few minute

Server Shield Protect your Linux serverServer Shield is a lightweight method of protecting and hardening your Linux server. It is easy to install, hard to mess up, and makes your server instantly and effortlessly resistant to many basic and advanced attacks.

All IP addresses will be automatically detected and used for the firewall configuration. Automatic security updates are enabled by default.

No maintenance required— just set it and forget it!

Features

  • Slowloris Protection
  • Firewall Hardening
  • ICMP/Ping Flood Resistance
  • FTP/SSH Bruteforce Protection
  • Automatic Security Updates
  • Disables Bash History
  • DNS Amplification Protection

Note: Server Shield requires Iptables
yum install iptables

Installation
git clone https://github.com/bluedragonz/server-shield
cd server-shield
chmod +x sshield
mv sshield /etc/init.d
/etc/init.d/sshield start

More Details on this project on github: https://github.com/bluedragonz/server-shield