Sunday 16 February 2014

Ubuntu power putton behavior shutoff to popup context menu

http://askubuntu.com/questions/362914/how-to-prevent-the-power-button-to-shutdown-directly-the-system

http://askubuntu.com/questions/385706/etc-acpi-powerbtn-sh-for-full-shutdown-menu/385716#385716

$sudo nano /etc/systemd/logind.conf

Uncomment 'HandlePowerKey=ignore', save and exit.

$sudo nano /etc/acpi/powerbtn.sh

Last line reads /sbin/shutdown -h now "Power button pressed"
Comment it out, and add new line

gnome-session-quit --power-off

Save and exit.

sudo restart systemd-logind
 -----------------------------------
No response following the post,

$whereis gnome-session-quit
$sudo nano /etc/acpi/powerbtn.sh

fixed the line to read /usr/bin/gnome-session-quit --power-off




Thursday 13 February 2014

How to see all the history of commands ever typed in a log file

http://askubuntu.com/questions/23057/i-would-like-to-create-a-log-of-all-commands-typed-in-terminal

$nano ~/.bash_history


type CTRL+R in terminal and give a keyword, then repeat CTRL+R for next search



http://www.cyberciti.biz/faq/clear-the-shell-history-in-ubuntu-linux/

To clear the history,
$history -c
or
$sudo rm ~/.bash_history


To clear history each log out
$echo 'history -c' >> ~/.bash_logout


Never create a history file
$echo 'unset HISTFILE' >> ~/.bashrc 
$echo 'export LESSHISTFILE="-"' >> ~/.bashrc

Ubuntu 12.04.4 LTS setup vncserver ssh server

on ubuntu system,

$sudo apt-get install openssh-server
$sudo apt-get install gnome-core
$sudo apt-get install vnc4server

then configure


tools;
vncviewer
putty


http://rbgeek.wordpress.com/2012/06/25/how-to-install-vnc-server-on-ubuntu-server-12-04/

Wednesday 12 February 2014

Reinstalling grub2 after installing an OS on a new partition

On my test system there is linux mint 16, and just finished installing kali.

I made a mistake of overwriting grub on /dev/sda and this has inverted boot order.

Boot order can be changed easily, but instead I want the original boot loader list provided by linux mint.

https://help.ubuntu.com/community/Grub2/Installing

So, boot into the mint 16, I just want to overwrite everything for simplicity.

$sudo grub-install /dev/sda

/usr/sbin/grub-bios-setup: warning: Sector 50 is already in use by the program 'FlexNet'; avoiding it.
This software may cause boot or other problems in future.
Please ask its authors not to store data in the boot track.
Installation finished. No error reported.

$sudo reboot

Now on the boot list, there is no kali install, but the original list shows.

On booting into mint,

$sudo update-grub
$sudo reboot


Now kali shows up as 'Debian GNU/Linux (Kali Linux 1.0.6)'

Fedora 20 Setup mail server for receiving admin alerts

SELinux Alert Browser popped with a dac_override error.

In notifying admin (for my own record so I can look at it later),

evolution needs to be set up.

All notification will be sent to my own computer; thus needs mail server.

http://servers.hostik.com/instructions/rhel-mailserver.htm

followed this procedure to set up.

And more information here,

http://docs.fedoraproject.org/en-US/Fedora/18/html/System_Administrators_Guide/s2-email-mta-sendmail.html

Tuesday 11 February 2014

Fedora 20 make nemo instead of nautilus for default file manager

http://forums.fedoraforum.org/showthread.php?t=293444

$ sudo yum install nemo -y
$ nano ~/.local/share/applications/mimeapps.list

add this line
[Added Associations]
inode/directory=nemo.desktop;nautilus.desktop;

save

Monday 10 February 2014

How to detect / defend against man in the middle MITM attack?

http://security.stackexchange.com/questions/6437/how-would-one-fully-protect-himself-against-man-in-the-middle-attacks

hp tablet tc4200 wireless hardware switch does not work in ubuntu 12.04.4 lts

Initially I thought there was no driver,

Tried to reinstall all the drivers from the hp website in windows.

http://techie-buzz.com/foss/wifi-ubuntu-install-broadcom-drivers.html
This seem irrelevant because my wifi adapter was intel 2200

However this worked.
http://askubuntu.com/questions/9816/wireless-shows-up-as-disabled-how-can-i-get-it-working

on terminal,
$sudo rfkill unblock all

This resolved the problem.
if problem persists, edit /etc/rc.local and add line "rfkill unblock all" above exit 0


More info
 http://ubuntuforums.org/showthread.php?t=1781350&page=2
http://ubuntuforums.org/showpost.php?p=10745874&postcount=4

Friday 7 February 2014

installing skype on fedora 20

http://www.if-not-true-then-false.com/2012/install-skype-on-fedora-centos-red-hat-rhel-scientific-linux-sl/

this guy also has lots of cool stuff on his blog too

Wednesday 5 February 2014

Changing environment variable for fedora 20

$nano ~/.bashrc

add following line

export PATH=$PATH:/path/to/dir

Ctrl+x, save and exit

$source ~/.bashrc

$echo $PATH

http://unix.stackexchange.com/questions/42146/changing-an-environment-variable-like-path-forever

https://ask.fedoraproject.org/en/question/24028/how-to-set-environment-variable-permanet/
difference between per-interactive-shell script / login shell

Monday 3 February 2014

VirtualBox on fedora 20 kernel driver not installed (rc=-1908)

http://forums.fedoraforum.org/showthread.php?t=237427

su
yum install kernel-devel gcc gcc-c++ make automake
yum groupinstall 'Development Tools'
/etc/init.d/vboxdrv setup

still not working