Tuesday, April 19, 2016

Fedora 21 change device name to default

The 2 commands to be entered:

  1. net.ifnames=0
  2. biosdevname=0
Location to place the 2 commands and to complete the steps is as follows:
  1. Locate the file /etc/default/grub
  2. Look for the command: GRUB_CMDLINE_LINUX
  3. Append: net.ifnames=0 biosdevname=0 at the end of the GRUB_CMDLINE_LINUX within the double inverted commas
  4. Save the file
GRUB_CMDLINE_LINUX="... ... rhgb quiet net.ifnames=0 biosdevname=0"
  1. Terminal# grub2-mkconfig -o /boot/grub2/grub.cfg
  2. Terminal# reboot

Reference

Wednesday, April 13, 2016

Set Own URL for localhost apache

2 areas to look at...


  1. /etc/hosts
  2. /etc/httpd/conf/httpd.conf
  • For /etc/hosts
    • Add the IP address and the URL (ServerName) in this file
 Example: 127.0.0.1  www.mywebsite.com
  • For /etc/httpd/conf/httpd.conf
    • Add the following
 <VirtualHost *:80>
  ServerName www.mywebsite.com
  DocumentRoot "/var/www/'where the folder is'"
  DirectoryIndex index.html OR 'which ever file'
 </VirtualHost>


After everything done...
  1. Restart httpd.service
    • Terminal# systemctl restart httpd.service
  2. Restart web brower

Reference

Wednesday, April 6, 2016

Enable/Disable Touchpad

Finally! After some search and suffering all the wrong clicking and shit, found the way, and tested it worked for Enable/Disable touchpad on my laptop with Ubuntu 14.04 LTS.


  •  Find out what is the xinput <id> of the touchpad
    1. Terminal# xinput list

    1. Go to System Settings > Keyboard > Shortcuts > Custom Shortcuts
    2. Add 2 shortcuts naming
      1. Disable Touchpad
        • Name: "Disable Touchpad"
        • xinput set-prop 12 "Device Enabled" 0
      2. Enable Touchpad
        • Name: "Enable Touchpad"
        • xinput set-prop 12 "Device Enabled" 1
    3. Then select the key combination for activating the shortcut

Reference

Thursday, March 10, 2016

Auto start up script for Linux

DO NOT~! And I say DO NOT do an infinite loop for auto start up script before doing the necessary steps below~


  1. Backup the state of the machine before doing anything potentially stoopid
And that is the only step. If what is done, it is done stage, prepare a liveCD. Using the liveCD can get you in and resolve that issue.

Sunday, February 28, 2016

Permission Problem again...

Linux is good~ Always having permission problem. Always stopping me from making things work. Damn. Apache, which is the httpd service. Due to the fact that execution of bash script is done by thr "root" account, user Apache, have no permission to do it.

Fix the problem~

Problem is solved... 
By cheating... Damn... Using the command, "system('echo "ROOT PASSWORD" | sudo -u root -S COMMAND')"; will trigger the necessary access needed to run iwlist.


Reference

http://stackoverflow.com/questions/5652986/php-sudo-in-shell-exec

Monday, February 15, 2016

Functionality Consideration


  • The Webpage
    • Access Point (AP)
      • Changing AP SSID
      • Changing DHCP IP range
    • WIFI point
      • Display available wifi scan result
      • Enter WPA password to mouse click select WIFI

WIFI connected to AP

Dumb thing to do but it was done and it worked. Just to prove that the WIFI can connect to the AP.

Let's start and go to the process then~

  1. Run my "testscript2.sh" bash script with root
  2. Follow that, enable the second wireless dongle and follow the reference steps
    • Last step from the reference actually also verified if the wireless dongle is connected to the network

Reference