неделя, 18 ноември 2012 г.

Finding out the rooters pppoe password

Ok, I'm not a fan of hacking or something, but it turned out that our new internet provider uses PPPOE password to identify the users and of course, they don't provide that password. The problem is that their router sucks and we want to use our own router which is much better. So the question was how to find the password. Well, it turned out there is a way.
In short, you have to make a backup file of your router configuration from its admin menu, and then to help comes this lovely program RouterPassView. It works with Wine, so you don't need Windows. To find the needed password, you just open the backup file with the program and Voila!
Searching for it, I also found this site for hacking your BSNL broadband router. Didn't try it, so I don't know if it works. Again, nothing illegal going on here, only me, getting the internet I paid for, without the assistance of the lousy router it comes with.

сряда, 14 ноември 2012 г.

pm-suspend not working after update of ati-drivers

For a long time, I kept my system using ati-drivers-12.5 to avoid the problems with the lack of support of my ATI Radeon video card (HD 2600). But after my latest update of the KDE (done with masked ati-drivers and ati-userspace) it turned out, I couldn't start X. So I decided to upgrade to the new 3.6 kernel and see what happens. A step before reverting to the ati open-source driver, I noticed that entropy features the 12.6 beta driver which I knew about, but could find when I needed it. So I decided to try it.
Well, it turned out it works fine. The official name is ati-drivers-12.6_beta_pre897. With it, you can use the latest kernel and KDE, the only thing you need to mask is ati-drivers>12.6 and ati-userspace>12.6 in /etc/entropy/packages/package.mask .  With it, everything works fine, including 3d acceleration and so on, so I am quite happy with it. The only problem I encountered was that suspend-to-RAM and suspend-to-disk didn't work, even though it worked fine before. After 3 days of digging, I found the root of the problem.
It turned out that in the lines of the kernel in GRU, one must include
radeon.modeset=0
"If a user installs Catalyst/FGLRX and kernel mode setting is not disabled for Radeon with radeon.modeset=0 on the kernel line in GRUB, then eventually the entire system will stop booting at the point where X should be loading, and the monitor will suspend itself since nothing is sending it a video signal. At this time, the system also stops responding to the keyboard so ctrl-alt-del or other key combinations to restart the system have no effect." (source)
Adding this line, and also the script below solved my problem completely:

=================
The original post of this script can be found here.
gksudo gedit /etc/pm/sleep.d/20_custom-ehci_hcd
or
sudo nano /etc/pm/sleep.d/20_custom-ehci_hcd

#!/bin/sh
#inspired by http://art.ubuntuforums.org/showpost.php?p=9744970&postcount=19
#...and http://thecodecentral.com/2011/01/18/fix-ubuntu-10-10-suspendhibernate-not-working-bug
# tidied by tqzzaa :)

VERSION=1.1
DEV_LIST=/tmp/usb-dev-list
DRIVERS_DIR=/sys/bus/pci/drivers
DRIVERS="ehci xhci" # ehci_hcd, xhci_hcd
HEX="[[:xdigit:]]"
MAX_BIND_ATTEMPTS=2
BIND_WAIT=0.1

unbindDev() {
echo -n > $DEV_LIST 2>/dev/null
for driver in $DRIVERS; do
DDIR=$DRIVERS_DIR/${driver}_hcd
for dev in `ls $DDIR 2>/dev/null | egrep "^$HEX+:$HEX+:$HEX"`; do
echo -n "$dev" > $DDIR/unbind
echo "$driver $dev" >> $DEV_LIST
done
done
}

bindDev() {
if [ -s $DEV_LIST ]; then
while read driver dev; do
DDIR=$DRIVERS_DIR/${driver}_hcd
while [ $((MAX_BIND_ATTEMPTS)) -gt 0 ]; do
echo -n "$dev" > $DDIR/bind
if [ ! -L "$DDIR/$dev" ]; then
sleep $BIND_WAIT
else
break
fi
MAX_BIND_ATTEMPTS=$((MAX_BIND_ATTEMPTS-1))
done
done < $DEV_LIST
fi
rm $DEV_LIST 2>/dev/null
}

case "$1" in
hibernate|suspend) unbindDev;;
resume|thaw) bindDev;;
esac

$sudo chmod 755 /etc/pm/sleep.d/20_custom-ehci_hcd
====================
I'm not sure if the script was needed or not, but the fact is that my system now suspends alright.
Other useful commands I discovered in the process:


To trace problems in pm-tools (remember, pm-tools fight with laptop-mode-tools, make sure to uninstall the second)
sudo sh -c "sync; echo 1 > /sys/power/pm_trace; pm-suspend"
(source)
Problems with DPMS   (Display Power Management)
You can manually invoke and control DPMS using the xset command line tool:

sleep 1; xset s activate

Or to turn the screensaver off:

sleep 1; xset dpms force off

You can also use commands standby, suspend, or on instead of off.

Another workaround is to disable DPMS in xorg.conf, by adding an option to your Monitor section:

Section "Monitor"
...
Option "DPMS" "Off"
EndSection
(source)
Other options of the kernel hich might work or not:
pcie_asm=off or nomodeset (source)


I also tried ("acpi_osi=Linux") , but it didn't help.

A German wiki for pm-utils (source).
Some cool stuff you could do with pm-utils (like setting up wake up alarms and so on) you can find here.
In case you would like to read more on laptop-mode-tools (which I used successfully with the previously kernel, along with pm-suspend), you can find here. With it, you can manipulate the default display brightness and so on.