Friday 31 January 2014

Recover MySQL root password


Stop the MySQL server process
 
/etc/init.d/mysql stop

Start again with no grant tables
 
mysqld_safe --skip-grant-tables &

Login to MySQL as root
 
mysql -u root

Set new password
 
mysql> use mysql;
mysql> update user set password=PASSWORD("password") where User='username';
mysql> flush privileges;

Exit MySQL and restart MySQL server

mysql> quit
/etc/init.d/mysql stop
/etc/init.d/mysql start

Set root password if there is no root password
OR
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
 
mysql>SET PASSWORD = PASSWORD('new_password');

Allow the user to connect to the server from localhost using the password

mysql>grant usage on *.* to 'username'@'%' identified by 'password';


Wednesday 15 January 2014

Open Soruce Distributions and Applications

 Open-Source Software (OSS) is computer software with its source code made available and licensed with a license in which the copyright holder provides the rights to study, change and distribute the software to anyone and for any purpose. Open-source software is very often developed in a public, collaborative manner. Open-source software is the most prominent example of open-source development and often compared to user-generated content or open-content movements.

1. Desktop Distribution

Arch
Bodhi
Chakra
CrunchBang
Debian
Fedora
Fuduntu
Gentoo
Linux Mint
Mageia
Mandriva
Manjaro
MEPIS
openSuse
PClinuxOS
Puppy
Sabayon
Salix
Slackware
SolusOS
SparkyLinux
SUSE Linux
Ubuntu
VectorLinux
Zorin OS

2. Browser

Chrome
Chromium
Conkeror
Dillo
dwb
Epiphany
Firefox
Konqueror
links/elinks
Luakit
lynx
Midori
Opera
QupZilla
rekonq
SeaMonkey
SlimBoat
Uzbl
w3m

3. Open Source Web Framework

Apache Wicket
CakePHP
Cappuccino
CodeIgniter
Django
Express
Flask
Grails
Pyramid
Ruby on Rails
Sinatra
Spring
Struts
Symfony
web2py
Yii
Zend Framework
mojolicious
Laravel

4. IDE/Web Development Editor


Anjuta
Aptana Studio
Bluefish
Code::Blocks
Eclipse
Emacs
eric
Geany
IDLE
Kdevelop
Komodo
Kompozer
Lazarus
Leo
MonoDevelop
Netbeans
Qt Creator
Quanta
Quanta Plus
SeaMonkey Composer
Zend Studio

5. Audio Media Player Application

amaroK
Aqualung
aTunes
Audacious
Banshee
Clementine
cmus
DeaDBeef
Exaile
gmusicbrowser
MOC
MPD
mpg123
mpg321
Nightingale
Pogo
Quod Libet
RhythmBox
Sonata
VLC
XMMS
XMMS2

6. Video Media Player Application

Dragon Player
DVD-Player (XBMC)
FFplay
kaffeine
Miro
mplayer
mplayer2
Parole
Totem
VLC
xine

7. X Terminal Emulator

aterm
Eterm
GNOME Terminal
gtkterm
Guake
Konsole
Kuake
LilyTerm
LXTerminal
Roxterm
rxvt
Sakura
stjerm-terminal
Terminal (Xfce)
Terminator
Tilda
urxvt
xterm
Yakuake
Terminology
Termit

8. Mobile Distribution

Android
Chrome OS
CyanogenMod
Firefox OS
MeeGo
Mer
Replicant
Sailfish OS
Tizen
Ubuntu Phone
webOS

9. Programming Language

Ada
Assembly
AWK
C
C#
C++
Clojure
COBOL
Common Lisp
Erlang
Fortran
Free Pascal
Go
Haskell
Java
Javascript
Lua
Objective-C
Perl
PHP
Python
R
Ruby
Scala
Scheme
Tcl

10. Text Editor

Emacs
Geany
gedit
jEdit
joe
Kate
KWrite
leafpad
medit
Midnight Commander Editor
Mousepad
nano
Nedit
pico
RedCar
Scite
Scribes
vi
vim

11. Desktop Environment

Cinnamon
Gnome Shell
KDE
LXDE
MATE
Razor-qt
rox
Trinity-DE
Unity
Xfce

12. Virtualization Product

KVM
Linux-VServer
OpenVZ
Oracle VM
Parallels Workstation
QEMU
VirtualBox
VMware
Xen
LXC

13. File Manager

Caja
Dolphin
Double Commander
emelFM2
gentoo
Gnome Commander
Konqueror
Krusader
Midnight Commander
muCommander
Nautilus
Nemo
PCManFM
ranger
ROX-Filer
SpaceFM
Thunar
vifm
Worker
Xfe

14. Backup Application

AMANDA
Areca-Backup
Back In Time
BackupPC
Bacula
Clonezilla
cpio
Deja Dup
dump
Duplicity
FSArchiver
G4L
luckyBackup
partimage
rdiff-backup
Redo Backup and Recovery
rsnapshot
rsync
tar
Time Vault
Burp

15. Network Monitoring Application

Big Brother
Ganglia
GroundWork Monitor
Icinga
mon
monit
munin
Nagios Core
Nagios XI
NetXMS
OpenNMS
OpenQRM
Opsview
Shinken
Zabbix
Zenoss

16. Network Security Application

aircrack-ng
Bro IDS
ClamAV
dsniff
fail2ban
Firestarter
fwBuilder
Guarddog
kismet
Metasploit
Nessus
Nikto
Nmap Security Scanner
OpenVAS
p0f
Shorewall
snort
tcpdump
UFW/Gufw
Wireshark

17. Server Distribution

CentOS
Debian
Gentoo
Mandriva Enterprise Server
Oracle Enterprise Linux
Red Hat Enterprise Linux
Scientific Linux
Slackware
SUSE Linux Enterprise Server
Ubuntu LTS

18. Office Suite

Calligra
LibreOffice
OpenOffice.org

19. Window Manager

awesome
Compiz
dwm
Enlightenment
Fluxbox
FVWM
i3
IceWM
JWM
KWin
Marco
MetaCity
Mutter
Openbox
Ratpoison
Sawfish
spectrwm
Window Maker
wmii
xfwm4
xmonad
Notion
twm

20. Graphics Application

Art of Illusion
Blender
CinePaint
Darktable
GIMP
ImageMagick
Inkscape
Kolourpaint
Krita
LazPaint
LightZone
mtPaint
MyPaint
Pinta
RawTherapee
Scribus
Tux Paint
GrafX2
G'MIC

21. Open Source Game

0 A.D.
Armagetron Advanced
AssaultCube
Battle for Wesnoth
BZFlag
FlightGear
Freeciv
Frets On Fire
Frozen Bubble
GNU Chess
LBreakout2
MegaGlest
Minetest
NetHack
Neverball
Open Arena
OpenClonk
OpenTTD
Pingus
Pioneer
PokerTH
Red Eclipse
StepMania
SuperTux
SuperTuxKart
The Mana World
TORCS
Trigger Rally
Tux Racer
UFO: Alien Invasion
Ur Quan Masters
Warzone 2100
World of Padman
Xonotic
FreeOrion

22. Privacy Solution

Adblock Plus
Disconnect
Ghostery
GnuPG
NoScript
Privoxy
Tor Browser Bundle
TrueCrypt
LastPass
HTTPS Everywhere
PasswordMaker
DoNotTrackMe

23. Open Source CMS/Blogging platform

Alfresco
b2evolution
CMS Made Simple
Dotclear
DotNetNuke
Drupal
eZ Publish
Joomla!
MODx
Movable Type
Octopress
Plone
Roller
Serendipity
SilverStripe
Textpattern
TYPO3
WordPress
XOOPS
Ghost

24. VoIP Application

Blink Qt
Ekiga
Empathy
Jitsi
KPhone
Linphone
Mangler
Mumble
opensoftphone
QuteCom
SFLphone
Skype
TeamSpeak
Twinkle

25. Database

DB2
Drizzle
EnterpriseDB
Firebird
MariaDB
MySQL
Oracle
Percona
PostgreSQL
sqlite

26. Revision Control System

Bazaar
BitKeeper
CVS
Fossil
git
Mercurial
Perforce
Subversion

27. Messaging Application

aMSN
BitlBee
CenterIM
EKG2
Empathy
Finch
Gajim
Gwibber
Gyachi
Irssi
Jitsi
Kadu
KDE-Telepathy
KMess
konversation
Kopete
Pidgin
Psi
qutIM
WeeChat
XChat
Hexchat

28. Configuration Management Tool


Bcfg2
cdist
Cfengine
Chef
Puppet
Salt stack
Spacewalk
Ansible

29. Host Security Application

AIDE
AppArmor
Bastille
chkrootkit
grsecurity
Lynis
Osiris
OSSEC
Rootkit Hunter
Samhain
SELinux
TOMOYO
Tripwire

30. NoSQL Database

Cassandra
CouchDB
HBase
Hypertable
Membase Server
MongoDB
Redis
Riak
Voldemort
Neo4j
Couchbase

Ref:- http://www.linuxquestions.org


Friday 3 January 2014

Immutable files in Linux

Chattr

chattr is a command in the Linux operating system that allows a user to set certain attributes on a file residing on many Linux filesystems.

touch filetest.txt

To display the attributes
lsattr filetest.txt
------------- filetest.txt

To set file attributes
chattr +i filetest.txt

lsattr filetest.txt
----i-------- filetest.txt

To test the functionality
mv filetest.txt file.txt
mv: cannot move `filetest.txt' to `file.txt': Operation not permitted

rm -rf filetest.txt
rm: cannot remove `filetest.txt': Operation not permitted

echo "HI" > filetest.txt
-bash: filetest.txt: Permission denied

To remove the immutable attribute
chattr -i filetest.txt
lsattr filetest.txt
------------- filetest.txt

To append operations
chattr +a filetest.txt
lsattr filetest.txt
-----a------- filetest.txt

test the functionality
rm -rf filetest.txt
rm: cannot remove `filetest.txt': Operation not permitted
mv filetest.txt file.txt
mv: cannot move `filetest.txt' to `file.txt': Operation not permitted
echo "replacing content" > filetest.txt
-bash: filetest.txt: Operation not permitted
echo "appending new content" >> filetest.txt
appending new content

To remove the immutable attribute
lsattr filetest.txt
------------- filetest.txt

How to Recursively change attributes of directories and their contents.

chattr -R +i test
lsattr test/filetest.txt
----i-------- test/filetest.txt

chattr -R -i test
lsattr test/filetest.txt
------------- test/filetest.txt

chattr -R +a test
lsattr test/filetest.txt
-----a------- test/filetest.txt
chattr -R -a test

Ref:- http://www.adminarticles.com/file-attributes/