Tag Archive for 'linux'

Shutdown, Reboot, Suspend or Hibernate with user priviliges via D-Bus

Some distros don’t allow you to
shutdown -r now
from terminal without superuser password.
Shutdown/Reboot/Suspend/Hibernate with user priviliges in Linux is possible via D-Bus. You just need consolekit and upower packages installed.

Here are the commands:

Operation D-Bus command
Suspend dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend
Hibernate dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Hibernate
Reboot dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart
Shutdown dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop

Just paste them in your beloved terminal emulator and press enter :)

Rutorrent + rTorrent on Debian Server

ruTorrent logoOnce, I’ve installed it myself.
Yes, in the way, everyone did this: checkout, compile with xml-rpc support, install web-server, bind everything together and enable some security.
It worked great, but after some updates, it broke up. Don’t know what happened exactly, I was a bit busy at that time.

Several weeks ago, I desperately needed torrent client, but in that environment, no applications could be installed. It was a great disappointment to find out, that me own rTorrent is down on the server. So I tried to perform mentioned actions again, but with no luck.

Right at that moment, I found out about an AWESOME!!! script, which does everything you need! It just installs

  • rTorrent
  • ruTorrent
  • your favourite web-server
  • FTP
  • Webmin

It binds everything together, and it just works!

Here’s the MAGIC link to the documentation:
http://forums.rutorrent.org/index.php?topic=608.msg4427
Everything is pretty strait-forward and troubleless.

Hint: run the downloaded script inside screen session. Script, itself, runs several minutes. It configures and compiles everything. So, please, be patient. If you have poor ssh access, it would be much better to reattach to the running screen process, after connection failure or something.

The only thing, I had to modify afterwards, was a web-server’s port, ’cause my ISP blocks port #80.
As I’ve chosen lighttpd, as my webser, I had to modify lighttpd config file
nano /usr/share/lighttpd/lighttpd.conf
and set
server.port = 1234

Windows 7 fail

I’ve recently got access to MSDNAA. That’s MSDN Academic Alliance. This program for universities allows students to get Microsoft tools free of charge for personal use.

My dream was to have licensed version of Microsoft Windows. In post-soviet countries, it’s really that hard to use one. But with msdnaa my dream came true.

I’ve downloaded client application (<500kb). This one is downloading iso-image of the item, I’ve chosen on microsoft.com. Finally, it downloaded 2,3 Gb Windows 7 Professional Retail x86 iso-file.

Unfortunately, I had no free dvd-r at that moment, and my dvd-drive was in such a horrible state, that it could hardly read any dvd. I don’t even mention it’s ability to write smth :/ But lightscribe works as it should :)

So, I’ve downloaded Microsoft ISO2USB tool. This one allows users to burn their iso to usb-drive, and install OS from it. Unfortunately, it failed. That one needed some extra libraries, which I couldn’t find.
I found one third-party tool, which did that for me.

I’m rebooting my system… and there it is! Windows 7 installation!
Unfortunately, right after first screen, my setup failed :) It couldn’t find any drivers for my lapton, so with the message “Insert dvd/choose location of drivers” all my dreams fainted.
I’ve been trying lot’s of solutions. But nothing could help me.
The only outcome, I’ve faced was: several new partitions on hard-drive, no OS at all.

Right at that moment, I’ve found my Ubuntu 10.10 CD. That’s the only non-brain-damaging solution! It installed from the first time. No pop-alerts! Easy as abc! Even after logging into my braid new ubuntu installation, I wasn’t satisfied enough. I had a valid Win7 Pro key! I had no Win7 Pro. That’s ridiculous.

I thought, the only place in internet, where I can find valid iso-image of Win7 can be somewhere in torrents! I’ve logged into one of the most popular torrent sites out here and quickly found Genuine Win 7 Retail.

But there where no Pro. Only Ultimate revisions. Somewhere, I’ve read, that Ultimate installation has all the versions inside: from Starter to Ultimate, except Enterprise. And yes! You just have to remove or modify
/isoimage/sources/ei.cfg file! That definitely cool :)

I’ve downloaded win 7 ultimate, changed that ei.cfg with the one from the image, which I’ve got from msdnaa. Finally I’ve got working Windows 7 Professional installation image. The only problem was, that I installed Ubuntu, and got too accustomed to it. Moreover, my dvd-drive wasn’t working correctly :) I’ve downloaded Virtual Box and installed Windows 7 Pro inside it. It completed successfully and passed validation test with the key provided.

Currently, I’m working under ubuntu, and waiting for the moment, when I’ll suddenly kill my system with “rm -rf /” :) Then, I’ll try installing Win7 once more :)

Have a nice day ;)

“Nothing to do in the university” problem?

My teacher unintentionally formatted his work flash-drive.
We tried to recover it with easyrecovery.
It was trial version.
We found full version, on torrent sites.
University is behind proxy, torrents are blocked.
Yesterday I installed rtorrent+rutorrent on my debian server.
Logged into it, downloaded that torrent file.
I can access downloaded file through ftp.
Started ftp-transaction… university proxy blocks 21 port.
Downloaded putty. Logged into web-server.
Moved downloaded file into web-server directory.
Downloaded file from browser in university.
Successfully recovered flash-drive data.
?????
PROFIT!

Backspace key in Firefox @ Ubuntu

I really enjoy using Firefox Web browser.
I started using it it’s 2.0 release.
I love that backspace key, which brings me back to the previos page.

I was disappointed, when in my lovely Ubuntu it did not!
I tried to go back, as I usually did that, and the key didn’t work.

That was irritating for me, so, if you have the same problem, feel free to use the following fix:

  1. Type
    about:config
    in address bar.
  2. Filter properties by:
    browser.backspace_action
  3. Double-click it and set it to
    0

Have a nice day!

ubuntu on hp 6735s: common afterinstall guidelines

After installing ubuntu on your hp6735s laptop it’s quite good to execute the following commands:

  • sudo gedit /etc/modprobe.d/alsa-base.conf
    and add
    options snd-hda-intel model=mobile
  • sudo gedit /etc/modprobe.d/options
    and add
    options snd-hda-intel model=mobile
  • that’s if your sound isn’t working :)

    *will be updating this page with good stuff for ubuntu/hp6735s laptop

hp6735s and ATI display driver in ubuntu

Situation:

  • I enjoy using Ubuntu!
  • I enjoy using Ubuntu 9.10 (cos’ I still haven’t upgraded to 10.04)
  • I have hp6735s laptop
  • I use ATI proprietary driver
  • everything is too smoothed on the screen
  • font look like shit
  • windows *** works fine

After digging a little I found out that the problem is:

  • not with the fonts
  • Ubuntu set wrong screen resolution for me: 1280×768
  • right screen resolution 1280×800 is not in the list in System > Parameters > Screen
  • right screen resolution is not available in ATI Catalyst either

Here’s how I fixed it:

  1. run sudo gedit /etc/X11/xorg.conf in terminal
  2. found something like Section "Monitor" ... Option "PreferredMode" "1280x768"
  3. changed 1280×768 to 1280×800
  4. everything works fine after reboot!
  5. compiz and all 3D effects work nice too!
  6. …and hey, it’s the first time I edited xorg.conf by hands!

Enjoy using linux!
That the OS you really need!

Watch your webcam in console!

Wow! I really love linux! I feel that with every minute spent inside linux my love to this OS grows up! It’s so outrageous! You can do almost everything!!!

Today, I was really shocked with the abilities of the mplayer!
Here’s a short video of what I’ve done:

So, here’s a list of what I was doing with it (everything is done in tty-conole->[Ctrl]+[Alt]+[F5]):

  1. I wondered if I can watch films in console. That’s real! You just have to specify the special output driver. It’s the ASCII-Art driver:
    mplayer -vo aa nameOfYourFile.avi
    You can enjoy colour video in console, just replace aa driver with the Colour ASCII-Art driver caca!
  2. I felt it’s not enough! So, I tried to watch my web-cam in console! Obviously, mplayer is able to do it! You just need to specify the tv:// protocol, instead of filename:
    mplayer tv:// -vo caca
  3. Here’s the first problem. The output is alright, but that stats information always updates, and the video is blinking:( So, it makes impossible for you to watch your wab-cam normally. I started to investigate the mplayer’s man page:
    man mplayer
    it’s so huge! (read it if you want :) )
    I quickly found the solution! Here is it: the parameter -really-quiet:
    mplayer tv:// -vo caca -really-quiet
  4. But that was not enough! I wish I can watch the web-cam, as I look at mirror! I found the parameter -flip. But it just turns everything upside-down. The real solution for that is the video-filter Mirror! Specify it & enjoy:
    mplayer tv:// -vo caca -vf mirror -really-quiet
  5. There’s one more improvement, you can do to your output. You can make it better by specifing the font. The smaller the font – the better’s the output. I usually use Uni1-VGA8:
    setfont Uni1-VGA8

That’s all, folks! Go and watch your favourite videos in console!

Genius G-Pen 4500 && Ubuntu 9.10

I’m about to use my Genius G-Pen 4500 with Ubuntu. And here is my experience in installing this tablet.

Everything is pretty stright-forward.

  1. Go to http://code.google.com/p/linuxgenius/
  2. Get the source for wizardpen. I used http://linuxgenius.googlecode.com/files/wizardpen-0.7.0-alpha2.tar.gz
    wget http://linuxgenius.googlecode.com/files/wizardpen-0.7.0-alpha2.tar.gz
  3. Unpack.
    tar -xvf wizardpen-0.7.0-alpha2.tar.gz
  4. Move into the unpacked dir:
    cd wizardpen-0.7.0-alpha2
  5. Configure, make and install:
    sudo ./configure --with-xorg-module-dir=/usr/lib/xorg/modules && make && make install
  6. Check for wizardpen.la and wizardpen.so (driver installed correctly):
    ls /usr/lib/xorg/modules/input/wizardpen.*
  7. Connect your tablet (if not yet connected)
  8. Create file /etc/hal/fdi/policy/99-wizardpen.fdi
  9. I used the following data inside the file:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <deviceinfo version="0.2">
    <device>
    <!-- This MUST match with the name of your tablet -->
    <match key="info.product" contains="UC-LOGIC Tablet WP5540U">
    <merge key="input.x11_driver" type="string">wizardpen</merge>
    <merge key="input.x11_options.SendCoreEvents" type="string">true</merge>
    <merge key="input.x11_options.TopX" type="string">0</merge>
    <merge key="input.x11_options.TopY" type="string">0</merge>
    <merge key="input.x11_options.TopZ" type="string">40</merge>
    <merge key="input.x11_identifier" type="string">stylus</merge>
    <merge key="input.x11_options.BottomX" type="string">32739</merge>
    <merge key="input.x11_options.BottomY" type="string">32745</merge>
    <merge key="input.x11_options.BottomZ" type="string">1024</merge>
    <merge key="input.x11_options.MaxX" type="string">32739</merge>
    <merge key="input.x11_options.MaxY" type="string">32745</merge>
    </match>
    </device>
    </deviceinfo>

    * This source code was highlighted with Source Code Highlighter.
  10. After all this You should reboot and start using your Genius G-Pen 4500.
  11. FIXED: I still have one unsolved problem. The stylus starts working a bit far from the tablet. Can’t resolve this. Under Windows I found quite unique driver, which let me set sensitivity for it. FIX: Add TopZ and BottomZ values to the file

День Вільного Програмного Забезпечення у Львові відбувся!

Вітаю усіх з успішним проведенням SFD2009′Lviv!

Отже, відбулась перша зустріч нашого OSUM-клубу.
З упевненістю можу стверджувати, що SFD2009 було проведено)

Спочатку Андрусів Остап зробив невеличке вступне слово, поділився з усіма присутніми своїми ідеями, і дещо розказав про open-source i OSUM.

Було дуже приємно, коли викладачі з легкістю погодились допомогти нам у проведенні SFD, і виступили із своїми доповідями.

Годич Олесь Васильович цікаво і в дуже доступній формі розповів усім про філософію open-source, типи free/open-source ліцензій,які на даний момент може вибрати лдя себе розробник (особисто мені запам*яиалась історія про “вірусну” GPL, нарешті зрозумів у чому її така унікальність), пояснив, чому проекти, які зв*язані з foundations набагато краще підтримуються і розвиваються, коротко розказав про найпопулярніші дистрибутиви linux, а також поділився своїм досвідом у використанні linux :)

Наступною була доповідь Гарасима Ярослава Степановича “Розв’язування наукових задач на платформі операційної системи Linux”. Ярослав Степанович коротко зупинився на безкоштовних дистрибутивах linux. Потім розказав усім про різні безкоштовні IDE, які можна використовувати у розробці під linux’ом: NetBeans, Lazarus, KDevelop, Eclipse, Mono… Відразу після цього було розказано про спеціалізовані вільні математичні пакети з підтримкою символьних обчислень і порівнях їх з платними аналогами. Хто уважно слухав – домашні з ДР/РМФ робить за 10 хвилин…

Як для першої зустрічі – досить непогано)

Слайдшоу з фоток із зустрічі:


Посилання на альбом

+прикріпив файли презентацій)

Пишемо свої враження від SoftwareFreedomDay2009)
Чекаю на ваші побажання і критику :Р




Hosted by EOMY.NET