One who rushes madly after inordinate desire, runs the risk of encountering destruction and death.
Ali Ibn Abi Talib[A.S]

Learning Python GUI using Tkinter

As I wanted to learn the python GUI, usingpythonI searched on internet and found these very nice tutorials on how to built GUI using Tkinter library of python. There are few more GUI libraries available on the internet as you may be aware such as wxpython, but I found Tkinter suitable for my needs and easy to work with. I started learning from UsingPython , it also has a good basic python tutorials if you want to have a refresher course.

pythoncourse

The other one was the Python Course which also has some really nice examples and a bit more than using python but both are good and you can start from either one.

Following are library references which are handy to know what things you can change using arguments.

Etc.. | Tagged , |

It’s like snapchat, but for files!

A service that I fell in love for file transfers!

fileio

Simply upload a file, share the link, and after it is downloaded, the file is completely deleted. For added security, set an expiration on the file and it is deleted within a certain amount of time, even if it was never downloaded.

 

Etc.. |

Configuring VLANs in Linux

Turn off the Network Manager

#chkconfig NetworkManager off

goto directory “/etc/sysconfig/network-scripts/” and edit ifcfg-eth0 or ifcfg-eth1.

#cd /etc/sysconfig/network-scripts/
#vi ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
HWADDR=00:0C:29:CA:19:29
HOTPLUG=no
IPADDR=10.10.1.230
PREFIX=24
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
IPV6_AUTOCONF=no
NAME="Ethernet1"
VLAN=yes

For creating VLAN with ID=300

#cp ifcfg-eth0 ifcfg-eth.300          //copy file and rename it to eth.vlanid
#vi ifcfg-eth.300
DEVICE=eth0.300
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
HWADDR=00:0C:29:CA:19:29
HOTPLUG=no
IPADDR=10.10.2.230
PREFIX=24
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
IPV6_AUTOCONF=no
NAME="VLAN300"
VLAN=yes

Then

#service network restart

You can create more VLANs by creating more files ifcfg-eth0.VLANID and replacing it with VLAN ID.

CentOS Command Line Installing Guide from Basic

After Installing CentOS, you will need to login on the screen:
login: user
password: root

For logging into root where you can change the configuration you need to write “su -”
The root password will be the one that is set at the time of the setup.
 

STEP -1
Setting Ethernet Interface Configuration:

For DHCP

[root@xomolinux network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0C:29:0E:BB:33
TYPE=Ethernet
UUID=e474a928-f297-4d28-a5be-6af5a0a86831
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=dhcp

For Static IP
DEVICE=eth0
HWADDR=00:0C:29:0E:BB:33
TYPE=Ethernet
UUID=e474a928-f297-4d28-a5be-6af5a0a86831
ONBOOT=yes
IPADDR=192.168.8.105
NETMASK=255.255.255.0
GATEWAY=192.168.8.1
DNS=8.8.4.4
NM_CONTROLLED=no
BOOTPROTO=none

To re-start the service

service network restart

 

STEP-2

Enabling Telnet
root@server ~]# yum install telnet telnet-server -y
Now the telnet has been installed in your server. Next open the telnet configuration /etc/xinetd.d/telnetand set disable = no:
[root@server ~]# vi /etc/xinetd.d/telnet
# default: on
# description: The telnet server serves telnet sessions; it uses \
# unencrypted username/password pairs for authentication.
service telnet
{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
disable = no
}

Save and quit the file. Now restart the telnet service using the following command:

[root@server ~]# service xinetd start
Starting xinetd: [ OK ]
Make this service to start automatically on every reboot
[root@server ~]# chkconfig telnet on
[root@server ~]# chkconfig xinetd on

Allow the telnet default port 23 through your firewall and Router. To allow the telnet port through firewall, open the file /etc/sysconfig/iptables and enter the lines as shown in red color:

[root@server ~]# vi /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p udp -m state --state NEW --dport 23 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 23 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

Save and exit the file. Restart iptables service:

[root@server ~]# service iptables restart
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]
iptables: Applying firewall rules: [ OK ]

Thats it. Now telnet server is ready to use.

Create a test user called “sk” with password “centos“:

[root@server ~]# useradd sk
[root@server ~]# passwd sk

Changing password for user sk.

New password:
BAD PASSWORD: it is based on a dictionary word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.

Check the Service Configuration
chkconfig --list

Linux |

Quick Fix for NTP DDoS Attack (Reflection Attack)

All you need to do is add few lines in linux ntp configuration file i.e ntp.conf

Here’s how your ntp.conf will look like- this is just one way of blocking the NTP reflection attacks.

restrict default ignore // Config to Restrict all by default

restrict NTP Server IP Address mask 255.255.255.255 nomodify notrap noquery
 // Deny any queries or modification requests from the NTP Server

restrict Client Subnet mask 255.255.255.0 //Needed only if the Linux Machine 
is acting as server to other clients.

server NTP Server IP Address

server 127.127.1.0

fudge 127.127.1.0 stratum 10 

Again this is just one way of doing it quick.

For more information read the security bulletin from the ntp.org.

Linux |

Detect Packet Errors In LAN Connection Status

Many of us are already using fast broadband connections these days and it’s important to know whether the information you are sending or receiving is correct and error free. When there is an error in sending or receiving data you might have problems downloading or uploading files and they could fail MD5 checksums or appear corrupt and the downloaded Zip or Rar archive won’t open etc. For example, if you keep getting errors sending packets but not receiving, then that could actually point to a faulty network adapter.

 

Error information can be an important first step in troubleshooting a connection. It’s very easy to view the basic network connection information, and you can see a network connection’s current status, connection duration, speed and packets or bytes sent and received for the connection. This is usually found by double-clicking the status icon in the system tray or going through Network and Sharing Center > Change adapter settings in Vista and above. The Status dialog box by default shows nearly everything but weirdly chooses not to display errors for the connection.

local area connection status

Before using sophisticated or tough to use packet sniffing software to detect packet loss and errors, you can just enable a hidden setting in Windows to show you any possible errors with your connection. Here’s how to do it with a quick registry change and the information will be added to the status dialog window.

[Read More: Full article by Raymond.cc]

TamoSoft Throughput Test

TamoSoft Throughput Test is a utility for testing the performance of a wireless or wired network. This utility continuously sends TCP and UDP data streams….

Click for more screen shots

[Read More]

Word Hippo ..Dictionary!

Word Hippo can do lots of other stuff which other dictionary can’t example includes:

Sentences with:

Words Containing:

Rhymes with:

Adjective For:

Adverb For:

And lot more.

Etc.. |

Persistent Header/ Sticky Header/Stick to Scroll Web (IE/Chrome/Firefox)

I was searching the internet on how to code a sticky header using javascript and found so many articles and multiple ways to achieve it but most of them didn’t work on IE or some of them were too complicated to understand for a person like me who has little know how of the Javascript. So after searching for hours I found the article below which was simple and easy to understand furthermore it was working on IE .

 

“Many must’ve seen this automatic-header-scroll-stick feature. Where a normal looking header suddenly sticks to the page when the page is scrolled.

Gmail to recently introduced such a “auto-sticking-interaction-header”. I thought I should give a simple explanation about it.”

<!DOCTYPE html>

<html>

<head>

<meta name="generator" content=
"HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">

<title>Auto Scroll Lock Header with jQuery</title>

<script src=
"https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"
type="text/javascript">
</script>

<style type="text/css">

table {

background: black;
color: white;
}

body, td {

font: 13px sans-serif;
}

#stickyheader {

width: 100%;
height: 10px;
}

#stickyalias {

display: none;
height: 10px;
}
#unstickyheader {

margin-bottom: 15px;
}
#othercontent {

margin-top: 20px;
}
</style>
</head>
....
...
..
.

 [Read More: Article by Ruturaj]

Etc.. |

Quick start guide using Git with Bitbucket

Git This is the very basic tutorial which will get someone like me who never used git before and will teach how to at least start doing the basic operations with git & using bitbucket repositories.

 

Upload Project to Bitbucket

If you already have the project stored locally just like I had you will first need to go through the following process.

-Install Git

-Create a Repository on bitbucketBitbucket Logo

-Goto the folder which you want to upload(In Git this is called Push) to bitbucket repository on your OS(Windows) right click and select Git Bash. It will open the Terminal

-On the Terminal Write:

$git init

-Next, add a remote called origin pointing at bitbucket.

$ git remote add origin https://you@bitbucket.org/you/repository_name.git

You can find the above information on the Bitbucket Repository Page, Get Started Tab.

-Create a notepad file xyz.txt in the folder.

-On the Term do

$git add --all
$git status

Above should show something like below:
# On branch master
#
# Initial commit
#
# Changes to be committed:
# (use "git rm --cached ..." to unstage)
#
# new file: xyz.txt
#

-Set Global Username & Email for the Git

$git config --global user.name "Your Name"
$git config --global user.email you@example.com

-Performing First Commit

$git commit -m "Importing my code" -a

The code has not been Pushed to the repository, however it has been saved locally

-To Push the Commit

$git push -u origin master

Anytime a change is made follow add, commit, push!

 

Download Project from Bitbucket

If you have sucessfully pushed the code/project to the bitbucket repository and now you would like to use the same code on different systems or share it between the group.

-Install Git

-Create directory where the code will be pull/downloaded

-Goto the folder ,right-click and select Git Bash. It will open the Terminal.

-On the Terminal Write:

$git init

-Next, add a remote called origin pointing at bitbucket.

$ git remote add origin https://you@bitbucket.org/you/repository_name.git

-Set Global Username & Email for the Git

$git config --global user.name "Your Name"
$git config --global user.email you@example.com

-Download/Pull from git

$git pull origin master

Now follow the same procedure explained above add,commit,push!

Etc.. |