Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Tuesday, 29 July 2008

Some pure old Mac fun

So i'm basically worn out of all these projects to hand out, and after an entire day completing the before last report, i've decided to take some free time and play with my Mac

I was so happy with the results that i want to share them with you all

1. Open in Terminal
Sometimes you're browsing with Finder and you find yourself in a relative long path; then you realize that you need to use a shell command on a file in that far away folder! oh the pain!
Open Terminal helps you with this task: if you move it to the application bar it will open a terminal in the folder selected/dragged/present in Finder! it comes with a contexual menu as well!

The only drawback is that it uses horrible icons, but you can change them and use these ones (follow the instructions reported) which are OpenTerminalHere ones

Open Terminal is much quickier than the other "open-here" apps because goes in the background, consuming no more than a Dashboard widget (but it works also without it, and it's alwasy a little faster than the others)

2. Open from Terminal
Here I'm reporting two tricks for when you are in the Terminal
The first one follows the above one: you can create an alias for calling the Open Terminal script that cds to the Finder active folder
alias cdf='eval `osascript /Applications/Utilities/OpenTerminal.app/Contents/Resources/Scripts/OpenTerminal.scpt `'
Put that line in your ~/.profile file and you're done (if you want to use it right away do source ~/.profile)
The second one is for opening the folder of where you are right now (in the Terminal)
open .
really that simple! open is a Mac utility that call the associated application for opening the what is given as argument, very useful; so if you "open file.txt" it will start TexEdit!

3. Cd Up
Last trick for the Terminal: when you are in a very long path (in Macs this happens often) if you go in another folder by mistake, you have to write the whole path again!
However if you put this simple line
alias up='cd "`env | grep OLDPWD | cut -f 2 -d =`" '
in your ~/.profile, you can return to your previous location just by calling up
This works also for any Linux distro :)

4. View in FullScreen
This is a nice AppleScript that opens a Finder Window in full screen in CoverFlow mode!
Very nice, but lacks of a nice icon! Fortunately you can use the lselect one found before.

5. Quicklook for source text files
So as i work mostly with VHDL, i wanted to have a way to have a quick preview of the source file, just like any other .c or .java file!

Well this is possible and it's also rather easy: inspired by this hint i started looking in every Info.plist files until i found the right one! The XCode one!

You just need to perform these simple steps and you'll be able to use Quicklook for .vhd and practically any other text file format.
  1. open /Developer/Applications/Xcode.app/Contents/Info.plist
  2. go to line 1439
  3. insert a line like vhd (replace vhd with the extension you need, i also added .dat and .cmm, but these two don't get highlighted)
  4. save the file and touch the application (touch /Developer/Applications/Xcode.app) to update the preference contents
  5. run a sudo qlmanage -r to restart the Quicklook daemon
6. X11 shorcuts like Mac shortcuts
Well, one of the reasons X11 is denigrated so much is that it has different cut/paste/save shortcuts, no drag and drop and different copy buffers

However this can be resolved very easily: just create a ~/.xmodmap file containg
keycode 63 = Control_L
keycode 60 = Alt_L
keycode 66 = Alt_L
clear mod1
clear Control
add mod1 = Alt_L
add Control = Control_L
In this way Copy and Paste will work like in Mac native apps, Cmd+c and Cmd+v, and all the shortcuts which required Control, will run with Cmd instead!


Well enough fun for now :)
It's time to go back working on GLX
Vittorio

Wednesday, 25 June 2008

upside down Webcams? here is the solution for Linux!

Here i'm posting a resolution for a tedious problem that is affecting many laptops in the world!

Some laptops come with an upside down webcam, physically speaking!
then the windows driver takes care of repositioning the stream in the correct position, but this doesn't apply to linux drivers!

Luckily for all of linux people, we've found a solution: one of mine Linux padwan that goes by the name of Marco Argiolas lost sleep to overcome this problem (having just bought a laptop with such nice feature)! He tried every possible howto, many tutorials and suggestions, but what left in the end was to dive in the sourcecode of the driver and patching for it to work!

well, he actually succeeded! now, any upside down webcam using the uvc driver can see it right! he posted the patch to the devel mailing list, but while the devs approve it, you can follow his tutorial at ubuntu forums
in english or
in italian

i'll keep you posted with updates
in the meantime, many compliments to Marco ;)

Vittorio

Friday, 4 April 2008

20s boot

Finally i had some time to play with Gentoo on the Toshiba M200 i bought from the USA.
this time i wanted to tune every possible bit of the kernel in order to obtain a quickest boot as possible! i seem to have managed to fullfill my plans!

here is a couple of hints i can share (some of them might a little bit risky)
  • first of all, i tried to make the kernel as small as possible, totally moduable a very little built in! i believe there's now only the pci, ide, generic x86 istructions and the root fs support, while all the rest gets loaded at boot.
  • to know which modules are absolutely necessary, take a look at the udev printing! move all the modules it loads to /etc/modules.autoload/kernel-2.6 and then disable the RC_COLDPLUG variable in /etc/conf.d/rc.
  • while in /etc/conf.d/rc you can also set the PARALLEL stuff in order to speed up services starting, but it's not very effective
  • i shrunk the root partition so that the checkroot service will take much less time for controlling the filesystem. While here i also modded the init script to hdparm the drive before performing the scan.
Well that's more or less what i tried to do, and everything seems to work fine!
next target: create an initramfs to load the modules for an even faster boot :)

Tuesday, 26 June 2007

Windows and Doors

When you do something wrong with fdisk you can say goodbye to your partition table!
that's what happened to me, but things were made worse by the nasty XFS resize tool which required a mounted partition to work...

anyway i don't want to talk about this little error of mine, but of what came after! I decided to put back Windows on, since there were too many incompatibilities and I wanted to try the Windows Server 2003 downloaded from the MSDNAA.

the installation was just like Windows XP, but only in this occasion i noticed that formatting 80GB with NTFS disk takes 40 minutes, with Reiserfs (or any other linux fs) takes less then 10 seconds...
So, like any other Windows, the first thing to do after a fresh install is to go to windowsupdate.com! I didn't set up a firewall because i tought that a server *might* already have some kind of protection from external threats! yet again, i overesteemated Windows...
In fact while I was trying to set up the graphic card in safe mode the nasty worm of "You have 60 seconds before reboot" show up! And since updates or virus scan weren't working any more i just had to rewind everything!

Yeah, after the usual 40 minutes of formatting and after installing i was prompted with a nice welcome, the ctrl+alt+del for entering! I set up the firewall right away and when I rebooted i was prompted with an even nicer welcome, a blue screen of death! Every time i tried to log in the system crashed and it was all firewall fault, in fact when i had uninstalled it the system went fine again...
Not only the firewall was driving me nuts (instead of Zone Alarm i put PCtool Firewall), but the antivirus as well was nagging at me!!!
I tried the main ones, Free-Av, AVGfree and Avast: AVG said its licence didn't allow installation on a server (are you crazy??? why???), Free-Av said it couldn't install on corporate business machine (I'm not a business, I'm a single person), and Avast simply refused to launch because i was in Windows NT (pure maddness, Windows XP is NT as well)
Lucky was that i found a GNU/GPL antivirus, ClamWin, that allowed installation anywhere, anytime! All hail to opensource!

Would you think that's all? Not at all! The best of all, the ATI graphics card!
Linux users know that Ati is not quite good at drivers for linux, but they would cheer up saying "at least windows drivers are fine" - WRONG!
There is NO driver for the ATI Mobility (chip R200) on Windows Server 2003! The official one would just screw the screen and force to continuosly reboot, the unofficial ones, like DNA or Omega drivers went just crazy (the former refusing to install and the latter setting up strange screen resoultions)

It all ended by cleaning everything up and putting up Windows XP yet again!
You know, i wasn't sure if I was dealing with a Windows or a Linux as they both had the same drivers issue with everything! That proves that it's not the operating system you use, but how well it's supported by third parties! So Windows XP has very good support, while Windows Server 2003 hasn't! So we could say Windows Server 2003 is the same of Linux... just a hundred times less stable :-)


ok we couln't :-D

Sunday, 17 June 2007

Yet another Linux embedded device

a few days ago a nice shiny Netgear WGT634U Router arrived to my place and happily started toying with it right away! Though not on sale anymore, it has very good features, like 108Mb/s wireless and a USB port for external hd.

So, i booted it up and tested with the DS and the WII (as I mainly bought this router for its complete compatibility with Nintendo devices) and they were doing really fine! No encryption (just mac filtering) due to the poor DS security system. Anyway this router also proved a nice range and no lags! good! It was time to check its other options!

Unfortunately there were the usual silver linings! I tested the usb capability with my external usb drive, ntfs formatted - no writing allowed - it was readonly... so, since "linux partition" were supported i tried formatting it in xfs, reiserfs, ext3; noone showed up! cool!
Moreover when I tried to upgrade to the latest firmware the connection was refused and the old firmware kept!
Finally, what turned really me down was that there was no NFS support, but just a plain Samba server! ugly!!!

So these three convinced me to try linux on this router! there were two main options: OpenWRT and OpenWGT! The latter should be dedicated for this router,
WGT634U, but it's not really developed any more; so i tried the former, which has a wider support for routers of all kind!

OpenWRT has two main release: White Russian, stable branch, and Kamikaze, development branch. These two version differ mainly on the configuration method! With Russian you have to play with the nice nvram command, with Kamikaze you can swiftly modify files in /etc to change configuration. Kamikaze was the only to support my router so I had very little choice.

That's it! I put it on the router! Wow! What has changed? mmm let's see the web interface! what? no web interface? well, let's try ssh! password required? what password?

ok the panic ended when I tried by chance to access with telnet! I set up a password and ssh was activated! I was really annoyed that there wasn't a web interface but i was soon proved wrong.
On the ssh consolle, it was like any other linux system, with all the most important commands!
After a while i found this little uselful program, ipkg, which acts exactly as apt-get!
With ipkg you can install any program available on the official repositories! And there are a lot! Kernel moduls, servers of any kind (cups, nfs, samba, ftp) along the normal stuff you find on routers (dhcp, firewall, wireless).

Later on, i also found out that there was actually a web interface, not included in the repositories as still in development, called webif (already installed in White Russian) which you can download from the openWRT site. It was really nice, but it was evident that it need much development (still usable though).

Then I wanted to try out the USB expansion port! I read you could use it not only as external hd, but with any usb device compatible in linux! So you could easily plug a hub and have nfs server, bluetooth device, print server and much more! I made some attemps at building a print server, but the wiki are only for White Russian, so the method provided didn't work (actually there was no /dev/usb/lp0, but if you create the node with
mkdir -p /dev/usb && mknod /dev/usb/lp0 c 180 0 it has been reported to work)


However i wasn't happy enough! It was cool having linux on the router but it was too bleeding edge and having Kamikaze didn't help! I was unsure whether to put a plain White Russian or back the original firmware! Since i tought my router was not supported i opted for the second!
And since i wasn't sure if the suggested method worked, i did so using the most unstable web interface!

Erasing linux...
this was the last output i would ever receive from this router! Yep, i bricked it! I could try to repair it with a serial cable but it's too much of a hassle, and so i decided to ask the vendor if they can replace it!


summing up! Linux on the router is nice, but you need to have an advanced level of linux knowledge, and be ready not to come back! If you have enough time to play with it though i would suggest giving a try to it anyway, as long as you don't want to put the original firmware back :-D

Tuesday, 15 May 2007

Linux's Internet Connection Sharing

While setting up my computers I had my Windows server (i know, that's a contracdiction) configured as gateway with the Internet Connection Sharing system.
However, as i had to reinstall the Nintendo Usb Connector, I could not access internet from my private lan! What's the solution? use the iptable of Linux (in another pc)

I'll report the solution i used which i found here (look for the Redhatter reply)


The computers by the way are doing fine! One pc ended up with Kubuntu Dapper, since all my other version were corrupted (don't ask how), another with Windows 98 (i didn't have time to configure a 586 pc...), another one with Gentoo with Xfce4 (which positively impressed me, really); all these were given to my friends which were very happy to have a way to experiment their first Linux :) !!!
The last one is torn apart, made with all the spare pieces of the other pcs! It has too little ram to have anything more than the command line, so i think i'll keep this waiting for other spare pieces to arrive (hoping that the Gentoo system installed doesn't get old too fast :o) )

Wednesday, 9 May 2007

Wireless miracle

Something really unexpected happened just a moment ago...
one of my contact showed off about his installing of ndiswrapper so exited by the news i wanted to try it myself! You have to know than i never tried this because i have a very weird wifi card (it's hybrid with a TV/Tuner card) so the last thing i could think was having it run on Linux!

The first trials were awful, i took the driver from my vendor's card and repeatly installed all the version i could find in it (there were winxp, winme, win98, win2k) but no one was functioning! The more it didn't work, the more I wanted it run!

As a last resort i had a peek in the system32/Drivers section in my windows partion... guess what!
The drivers were completely different from the one i downloaded!
so i took the .inf and .sys files, put them in linux, launched ndiswrapper, modprobe it and...

[ 278.678923] ndiswrapper version 1.43 loaded (smp=yes)
[ 278.688265] ndiswrapper: driver cb55n5x (Marvell,04/16/2005,2.0.0.16) loaded
[ 278.688499] ACPI: PCI Interrupt 0000:01:0f.0[A] -> GSI 22 (level, low) -> IRQ 21
[ 278.689208] ndiswrapper (ndis_encode_setting:390): unknown type: 4
[ 278.689232] ndiswrapper (ndis_encode_setting:390): unknown type: 4
[ 278.689240] ndiswrapper (ndis_encode_setting:390): unknown type: 4
[ 278.689249] ndiswrapper (ndis_encode_setting:390): unknown type: 4
[ 278.689257] ndiswrapper (ndis_encode_setting:390): unknown type: 4
[ 278.689296] ndiswrapper (ndis_encode_setting:390): unknown type: 4
[ 278.689316] ndiswrapper (ndis_encode_setting:390): unknown type: 4
[ 278.689441] ndiswrapper: using IRQ 21
[ 278.965031] wlan0: ethernet device 00:13:d4:99:40:cd using NDIS driver: cb55n5x, version: 0x2000010, NDIS version: 0x501, vendor: '', 11AB:2A01.5.conf
[ 278.965056] wlan0: encryption modes supported: WEP; TKIP with WPA, WPA2, WPA2PSK; AES/CCMP with WPA, WPA2, WPA2PSK
[ 288.889100] usbcore: registered new interface driver ndiswrapper
[ 293.871970] ADDRCONF(NETDEV_UP): wlan0: link is not ready

Yeah! my Asus P5WD2 Premium Motherboard with Wi-Fi / TV Hybrid is now working correctly (at least the wifi part :P)
I've also edited the list page on the Ndiswrapper site so that everybody can gain from my experience! The Ndiswrapper team made a really good job! Now i want to try if i can get other devices up with this nice tool :)

Monday, 7 May 2007

How Gentoo saved the day

I received a couple of very old computer, two pentium III 500, one pentium II and one pentium MMX; all the RAM together they had was less than 1 G and the pentium II was aldready dead...

Anyway I had to figure what to do with these "wonderful" computer and I thought to use them as a compiling station, using the unix tool distcc
I did previous attempt at installing other distros of linux, but the only one i wanted to try with distcc was gentoo!

A complete afternood was spent just trying to make the pc (the distcc server and the distcc client) see each other! However when I made it, the compiling process was as swift as ever!
Actually i had some weird problems with the bootloader that wouln't run correctly, but in the end i managed to compile everything (kernel included) in my gentoo box!
Afterwards i just copied all the files from one hd to another and the two pentium III were done! Two gentoo installation in one!

Now that i have 3 distcc server running i'll enjoy myself compiling the other bigger utilities like X and the desktop environment...

after all this it's likely that I'll give these pcs to whoever needs them :)

Wednesday, 2 May 2007

Catching up...

Well, this the real first post of the blog, so I think I'd better begin with what I've done till now and what I'm about to do!

Right now I'm studying Computer Engineering at the Politecnico in Turin and as you could guess I'm fond of anything related to Informatics and Technology!
I also have other interests like Cinema and Filmmaking, Photography and Videogames.
I mentioned fimmaking and photography because I actually like to make both: you can see my photogallery in DeviantArt and my short movies on YouTube (links are in the sidebar).
If you wish to watch my short go here.
As for the videogames I'm a Nintendo consumer since I have almost all their consolles like the DS Lite or the Wii (the GBA only is missing); I just love its videogames and its continuous innovation!

One last thing about computers, I'm a real supporter of the OpenSource (and Linux) world! All the projects you'll find here are under a GNU/GPL licence, so that you can use and distribute them as you like (and if you quote the author, he'll be very happy)!

I think that's all for now :)
Bye and thanks for stopping by
Vittorio



All the projects here are under a Creative Commons 3.0 licence! You can use and distribute them as you like (just quote the author so he knows his work is not useless)!

If you wish to get in touch with me write at projectsymphony@gmail.com