Linux
Find last system reboot
To find all system reboot date and time
# last reboot | less
find last five system reboot
# last reboot | head -5
To find last shutdown date and time
# last -x | grep shutdown | head -5
Who command to find last system boot time
# who -b
who command, to ..
Disable selinux on redhat or fedora
How to uninstall or disable selinux
There are many methods of disabling selinux.
# ls -Z /
# ls -Z /etc/
Disable SELinux Permanently
# cat /etc/selinux/config
SELINUX=disabled
SELINUXTYPE=targeted
SETLOCALDEFS=0
Where,
SELINUX - can take one of these three values:
enforcing - SELinux security ..
Tcpdump examples
How can I monitor all my connections to ssh?
How do I monitor all traffic except my ssh session?
tcpdump is the premier network analysis tool for analysing more on network traffic
# tcpdump -i eth1 -s 1500 port not 22
-s Define the snaplength (size) of the capture in bytes. ..
Alert text message in android
In Xml code create the button then call the onclick event function in java
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android: paddingBottom="@dimen/activity_vertical_margin"
android: paddingLeft="@dimen/activity_horizontal_margin"
android: paddingRight="@dimen/activity_horizontal_margin"
android: paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<EditText
android:id="@+id/mnum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/button1"
android:layout_alignParentLeft="true"
android:layout_marginBottom="30dp"
android:layout_marginLeft="96dp"
android:ems="10" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/email"
android:layout_alignParentTop="true"
android:layout_marginLeft="46dp"
android:layout_marginTop="170dp"
android:onClick="searchInUrl"
android:text="@string/button1" ..
Creating textbox, label and button
How to create textbox, label and button in android
Code from activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android: paddingBottom="@dimen/activity_vertical_margin"
android: paddingLeft="@dimen/activity_horizontal_margin"
android: paddingRight="@dimen/activity_horizontal_margin"
android: paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
//create text box
<EditText
android:id="@+id/mnum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/button1"
android:layout_alignParentLeft="true"
android:layout_marginBottom="30dp"
android:layout_marginLeft="96dp"
android:ems="10" />
//create label
<TextView
android:id="@+id/msg"
android:layout_width="wrap_content"
..
Setup svn repositary on development server
Follow these instructions to setup svn repositary in fedora:
You may already have subversion installed, if not, just run this:
# yum install subversion
# yum install mod_dav_svn
Create svn repo using svnadmin command:
# mkdir /svn
# chown -R apache:apache /svn
# svnadmin create --pre-1.6-compatible --fs-type fsfs /svn/myproject
Give full ..
Mobile apps development Titanium sdk
Install Titanium Studio , Titanium SDK and Android SDK
1) Download linux package from this link.
https://wiki.appcelerator.org/display/tis/Reverting+to+a+Previous+Version
2) First create the account in following website.
http://www.appcelerator.com/
3) Run the TitanumSudio from step 1, where you have download
4) Give the login Details and install Titanim studio
5) Install the JDK ..
Creating basic launcher in fedora
Basic Launcher Creation in Fedora
Here we will create a custom desktop launcher for Firefox. You can use this method to create a launcher for any application you like, though. On your Gnome or KDE desktop follow the steps given below.
1) Right-click on an empty area of your desktop.
2) Click ..
Location.hostname and location.host
What is the difference between location.hostname vs location.host
// Display Domain name and Port Number
location.host == "http://w3calculator.com:8080"
// Display Domain name only
location.hostname == "http://w3calculator.com"
Using hostname:
In most of ajax post method we use path name, On such situation we use hostname and its file path error to resolve ..
Best practice to do ping test
There are many different methods to keep your internet connections monitored, but the best practice to keep the internet connection monitored is the ping test. But how will make the ping test and to which IP we can do ping test? You all know Google servers never goes down, might ..
Vsftpd configuration for uploading and downloading
In this bluff we will see how to restrict an user from downloading and uploading of files to or from FTP server. To implement this security below are the steps.
On Redhat servers we normally use VSFTPD as the default ftp daemon. He we consider vsftpd service as a example to ..
Enable Wi Fi on Samsung Galaxy Note II
How can I connect or enable Wi Fi on Samsung Galaxy Note II?
1) Unlock your mobil phone
2) Go to "Settings"
3) Select WiFi
4) To see available networks, turn on Wi-Fi
5) Now, all nearby Wi Fi networks will be listed on the screen
..
Mac Address Samsung Galaxy Note II Mobile Phone
Where to find Wi Fi Mac address in Samsung Galaxy Note II Mobile Phone?
1) Unlock your mobile phone
2) Select Settings
3) Then select About Device -> Status
4) Click on Status to find all your mobile network connectivity status.
The above steps will help you to ..
Finding wifi address in iphone
Finding the wifi address in iphone is very simple and it is not very much complicated. To find the wifi address follow the below steps.
1) Once unlock the Iphone
2) Go to Settings
3) Then select About
4) Select -> WiFi Address
For Eg: x0:x3:yy:zz:aa
This will be your WiFi ..
Iphone With Authenticate External WiFi Router
How to connect Iphone with authenticated external wifi router
1) Go to Settings and select Wi Fi
2) Turn on Wi-Fi to To see the available WiFi networks,
3) WiFi Networks will be listed to connect
4) Click the arrow that displays near the WiFi network to connect which authenticate ..