Bitcoin donations are welcome:14snQXeLcnJtWUduKZ6rC2MHdPYrYar1Tw
Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Wednesday, April 7, 2010

How to get flv url

This is really easy in Linux, and can be used on all sites.

The solution is to use tcpdump via this command:
$sudo tcpdump -s 1514 -Ai en1 'tcp port 80 and tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420'

Thanks a lot to this blog:
http://blog.poundbang.in/post/29578268/using-tcpdump-to-extract-uris-to-flv-videos

To download afterwards use wget. Some sites might block direct downloads, then simply use the --referer= option in wget ;)

Saturday, February 13, 2010

Fastest image viewer for Linux

Have tried out a LOT of image viewers for Linux, and I thought they all were way to slow. A lot of them seemed to miss a feature called precaching or preloading, where the viewer preloads the next image you are about to view into the memory so it quickly changes to the next..

Ristretto has this feature, but still is VERY slow compared to my favourite. To bad, because I actually enjoy the interface, and it's really quick at loading thumbnails preview.

The one I found out to be the fastest without a doubt is GQView aka geeqie. When viewing my 6MB+ sized images from my DSLR they load very quickly, especially when browsing through a folder inside the interface so it preloads/precaches the next image I'm about to view.Link

Wednesday, January 27, 2010

Cheapest SDHC reader

Just got this one in the mail, and it's working perfect!

For only $1.52 including (free) shipping, you get a great & tiny USB SDHC reader. Which is a both easyer and faster way to extract i.e. photos from your digital camera. Works perfectly!

Click here to get it :)

Update 13.january 2013: Seems like the old version is sold out. This should be the exact same version! Go for it! :)

From the site:

"
- Supports SD, DV-RSMMC(MMC MOBILE), MMC, MiniSD(with adapter), MICRO SD(with adapter), T-FLASH(with adapter)
- Operating system: Windows 98/ME/2000/XP/Vista/Mac os 9.1 or above"

..and yes, it works in Linux as well :) Plug-and-play!

Wednesday, December 30, 2009

Java error after Debian Update (December 09)

Typical error messages:
Caused by: java.net.ConnectException: Network is unreachable
INFO: I/O exception (java.net.ConnectException) caught when processing request: Network is unreachable

Fix:
nano ~/.java/deployment/deployment.properties

Fix the following line like this:
deployment.javaws.jre.0.args=-Djava.net.preferIPv4Stack\=true

Wednesday, December 9, 2009

Multimedia shortcut keys in fluxbox

After having lot's of problems with multimedia key handling applets segfaulting, not reacting to keys and what-so-ever, I decided to go basic! And d*mn I'm glad I did so!

It took me 3 lines of work to get my Volume+, Volume- and Mute button to work like never before in fluxbox.

The short how-to:
1.) Open your ~.fluxbox/keys
2.) Add the following lines:

XF86AudioMute :Exec amixer set PCM toggle > /dev/null
XF86AudioLowerVolume :Exec amixer set PCM 1%- > /dev/null
XF86AudioRaiseVolume :Exec amixer set PCM 1%+ > /dev/null
3.) Save the file, reload fluxbox and it should work.

If you get no reaction, do this:
1.) Open an xterm
2.) run xev
3.) Push, let's say your Volume+ button, and see if you get a response containing the word "XF86AudioRaiseVolume". If it doesn't, you've found your problem. Find you X config files with all your keybindings and relocate it to the default settings.
4.) Try again :)

Lot's of more information and inspiration here! :)

Thursday, July 9, 2009

Spotify mutes and sound disappears

Had a lot of problems recently with the sound in Spotify suddenly muting/disappearing in the middle of listening to music, although the progress bar of the song I was listening to kept on moving. I am using Debian and using Spotify via wine.

Found the solution though which was quite simple:
Run winecfg, go to the Audio tab and select the following settings under the DirectSound settings:
Hardware accelration: Emulation
Def. Sample rate: 44100
Def. Bits per sample: 16
Turn OFF Driver Emulation.

Hope this helps :)

Wednesday, June 10, 2009

Tweaking Flash CPU usage in Linux

Update 22.12.2009
Great news has arrived just before Christmas. Adobe has released a new version of flash which finally gives us linux users what seems to be a proper improvement of the flash plugins capabilities in full screen mode. At least I am experiencing GREAT improvement when viewing flash videos in fullscreen. On my 3,5 year old laptop I can finally view HD videos on youtube in fullscreen without any problems.

The new version I am talking about is 10.0.42.34. The changelog can be viewed here. The 10.1 version is also in progress, but stay away from it if you are a linux user. Nothing new there for us, and I'm not even sure it has the latest linux tweaks available.

So, try to keep track that you always have the latest version of flash available, this you can easily do here. Downloading the latest version can be done here. Download the .tar.gz version. To install: Open up firefox/swiftfox and type about:plugins in the adressbar. Check where your current libflashplayer.so is located, and replace it. Make sure you do not have multiple installations of the plugin.

Important for INTEL graphics users:
Remember to have at least version 2.8.0 of xorg-x11-drv-intel, because:
* Fri Aug 07 2009 Kristian HÃgsberg - 2.8.0-4
- Add dri2-page-flip.patch to enable full screen pageflipping.
Fixes XKCD #619.


Old post with tweaks:
Last few days I've had a lot of problems regarding flash video in Linux. So I've spent a lot of time trying to tweak my browsers to work better. Here's my quickstep guide to getting flash working more or less "ok" in Linux. There is still a lot to be done for the flash developers making it work more flawless under Linux.

1.) Make sure you have the plugin for firefox, iceweasel og swiftfox. Check this by typing about:plugin in the address bar. If there are multiple instances of the same flash driver, remove them. Make sure you have the latest version, which at the moment (10th June 2009) shall be: Shockwave Flash 10.0 r22. If you have multiple drivers do a updatedb & locate libflashplayer.so in bash. Restart the browser when you are done.
2.) Cpu frequency stepping can be another problem. If you have powernowd or cpufreq installed make sure they are working proper. I had big problems with cpufreq only using 1ghz of my cpu although I had another 883mhz available. Check cpufreq-info and make sure:
A) current policy: frequency should be within 1000 MHz and 1.83 GHz.
Check that the upper frequency is correct.
B) The governor "ondemand" may decide which speed to use.
Make sure you are using the ondemand governor.
C) Now we are gonna tweak this so your computer will utilize your full cpu when viewing flash videos:
C.1) Stop cpufreq: /etc/init.d/cpufreqd stop
C.2) Edit your /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold and set it to 30. This will make your computer utilize your full cpu once the cpu usage climbs above 30%. You can always tweak this one to another setting if you want.
C.3) Start cpufreq: /etc/init.d/cpufreqd start
3.) We need flash to use your gfx card for the rendering, also known as hardware rendering. Flash uses Opengl in order to do this. Open aptitude, and remove _all_ opengl related packages, and then reinstall the following packages with it's dependencies:
libgl1-mesa-glx
libgl1-mesa-dev

Now try again :)

Please post more tips if you got any. No registration required.

Monday, May 25, 2009

Wireless iwl3945 on Debian

I have struggled A LOT lately trying to get my built-in wireless network card on my HP NX7400 to work. I seemed to have tried it all, and I could not understand why it would not work. I was using the iwl3945 driver, I could find the networks, but for some reason I could not retrieve dhcp information, and it seemed to not want to connect properly.

But I managed to get it working, finally. The solution? Easy. For some strange strange reason it will only work when using the new wicd (1.5.9) manager from KDE. If you are using fluxbox, as me, simply start it by running wicd-client in bash, and you will get a neat icon in your system tray.

A tip might be to add it to your fluxbox startup file:
nano ~/.fluxbox/startup
and add the following line:
/usr/bin/wicd-client &

Try it out. Hope it helps.

Thursday, May 21, 2009

UUID, Fstab and Automatically mount USB Drive

Finally found a solution on how to make my Linux (Debian):
A) Remember the unique USB drive(in my case a Western Digital Mirror Edition), and where to mount it
B) Automatically mount it when connected

First you have to identify your usb drive, make sure it is connected and you know the device name, in my case:
NoMore:/home# blkid /dev/sdc1
/dev/sdc1: UUID="6494BFE994BFBC3C" LABEL="My Book" TYPE="ntfs"
NoMore:/home#

As you see my drive has a unique ID. This is what we are gonna use in fstab instead of the device name. Smart huh? :) This way we avoid the problem of changing device names when plugging stuff in and out.

Next in fstab, make a line like this:
UUID=6494BFE994BFBC3C /home/user/DiSK/ ntfs-3g defaults,auto,umask=000,users,rw 0 0
Make the changes you need, but make sure you use your correct UUID(and remove the "") and it is set auto like above.

Next check if it works by typing:
mount -a
The -a parameter means it shall mount everything set to auto in fstab. If it works, umount your drive and let's continue:

Ok, make sure you got udev installed. This is what's gonna automaticly mount our drives when new ones are detected. Make a new file;
NoMore:/home# nano /etc/udev/rules.d/99-mount.rules
And add the following line:
SUBSYSTEM=="block", run+="/bin/mount -a"
Just make sure it uses the correct path to the mount command.
Next restart udev:
NoMore:/home# /etc/init.d/udev restart
Now unmount(umount) your drive, unplug it and try it out.

Wednesday, May 20, 2009

Error mounting NTFS in Linux

I have recently bought a Western Digital (WD) Mirror Edition 2TB, which I run in raid in order to offer me a really good backup solution for all my pictures and hd-videos from my SLR and important documents. The system is delivered with a NTFS system, which I knew obviously might cause some problems with Linux. As predicted, it happened today. I was just going to do a routine dismout (umount) and connect it to another computer when I ran into problems trying to unmount it. So I did a "umount -l" on the drive, which I apparently never should have.

Later when trying to mount the drive again in Linux (Windows always handles this stuff perfect), I got the following errors:

[root@nomore /]# mount -t ntfs-3g /dev/sdb1 /mnt/ntfs
ntfs_attr_pread_i: ntfs_pread failed: Input/output error
Failed to read of MFT, mft=10 count=1 br=-1: Input/output error
Failed to read vcn 0x4: Input/output error
Failed to mount '/dev/sdb1': Input/output error
NTFS is either inconsistent, or there is a hardware fault, or it's a
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
then reboot into Windows twice. The usage of the /f parameter is very
important! If the device is a SoftRAID/FakeRAID then first activate
it and mount a different device under the /dev/mapper/ directory, (e.g.
/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation
for more details.


So as instructed I connected the drive up to my computer running Microsoft Windows thinking the chkdsk /f command would fix it, but without luck. Tried dismounting properly aswell but it still refused to work.

But I found a solution. Go into "My Computer" while the drive is connected, right click on the drive, select "Properties" head to the "Tools" tab and under Error-checking click "Check now". Remember to tick both the options you get, and let it finish. This might take some time. For my 1TB USB drive it took a couple of hours. When finished, dismount the drive properly in Windows. I don't know if it matters, but just to be sure I dismounted it both with the WD tools and the windows plug&play manager.

I also rebooted my laptop running Linux, before I tired reconnecting. This time it worked perfectly again :) Thank god!

Sunday, March 15, 2009

HOWTO: Run Dialog Box in Fluxbox (Debian)

Here I have quickfix for this ;) First make sure you have a program called fbrun installed. Check by typing "exec fbrun" in a shell. If it's not there, find the app and install it (learn to use apt-get).

Next edit your ~/.fluxbox/keys file, and add the following line which will bind the Run dialogue to Alt+R:
Mod1 r :Exec fbrun -font Sans-16 -w 500 -h 50 -pos 250 350


save and exit, then rightclick on your desktop, select Reconfigure, and you are done :)

Tip: When the dialogue pops up, notice that you can use the up/down-arrows to browse your command history.

If it doesn't work, post a comment, if it works, please post a thank you :)

Wednesday, March 11, 2009

Setting up NTP client in Linux (Debian)

This is fast and easily done..

Get root privileges:
su
Then install ntp
apt-get install ntp
Then edit the config file
nano /etc/ntp.conf
Add the following:
server ntp.uio.no
driftfile /etc/ntp/drift
broadcastdelay 0.008
authenticate no

Replace the red text with a server from your area or you can use the NTP Pool Project servers which you can find here and can read more about here. The one above is for Norway.
Now restart the ntp client;
/etc/init.d/ntp stop
/etc/init.d/ntp start
And you are done :)

Monday, March 9, 2009

How to add calendar in conky (Linux)

Simply edit your .conkyrc file and add the following line:
${font DejaVu Sans Mono :size=8}${exec cal -m | cut -c23-44 --complement}

Some explanation:
The Font - Yep, you have to use that font, otherwise it wont come out right.
"cal -m" - If you want Sunday to be the first day of the week simply remove the -m.

If you are having any problems, please post in the comment field (no registration required and I will try to help you out).

Thanks!

UPDATE (Debian Users):
Unfortunately "cal" doesn't support weeks starting with monday anymore. The fix:
apt-get install gcal
New line for conkyrc;
${font DejaVu Sans Mono :size=8}${exec gcal --starting-day=monday | cut -c23-44 --complement}

Tuesday, February 24, 2009

How to record streaming WMV/ASF/MMS videos

In this howto I will be using mplayer to do the trick.

If you are using Linux you need to install mplayer, in debian you can simply type:
apt-get install mplayer
Otherwise you can get it both for Windows and other distros right here. (This will work for Windows as well, but I will from here on only explain how it works in Linux).

Next you simply start dumping/recording your stream like this in Linux:
mplayer -dumpstream mms://**********************

Mplayer will now start dumping/recording your stream :)

Common problem:
Stream not seekable!
nop_streaming_read error : Resource temporarily unavailable

If this happens after a while you probably just have to start over again, I could not find any solution for this anywhere else. The same think happened to me while trying to dump/record a stream from Nrk, but I simply tried again a little later on and it worked like a charm.

Tips:
While recording you can easily playback the video. Simply play the dump like this:
mplayer stream.dump


Happy dumping! :)

Friday, February 13, 2009

Nikon D90 and Linux

Easy howto:
1.) Install digikam which is a great tool for handling your photos.
apt-get install digikam
2.) Launch digikam,
Import -> Camera -> Add Camera -> Autodetect

You are ready to go :)

Tips: Check my post here about how to get a D90 remote for only $3.88 including all shipping and handling(worldwide).

Wednesday, February 11, 2009

Canon MP620 with Linux (Debian)

First install cups:
apt-get install cupsys

Then go to the configuration page for cups: http://locahost:631
Select Add Printer, and when asked for Device type, simply select ipp. In the next step simply type the printers IP. If you are unsure about the IP, scan your network with nmap like this:
nmap -sP 192.168.1.1/24 (will scan entire C-class network)
and the IPs for the printer will show up.

Next step it will probably ask for what printer you have, and it also gives you the option to add a ppd(driver). Go to this page and download and extract the english ppd you need. Next upload the ppd, and your printer shall now be ready to go :)

Wednesday, January 14, 2009

Livescribe Pulse Smartpen with Linux

Livescribe Pulse Smartpen is a ballpoint pen with a lot of digital capabilities. But what first caught my attention before even buying one was wether or not it would work with Linux. In this blog post I will keep updating with solutions on how to use it with Linux.
photo: livescribe.com
So far I have only found one confirmed and working way to use it. This is via Windows virtualization software like VMWare. The biggest problem with this is the fact that VMWare costs money. Another con reported is a little lag when docking the pen to the computer.

Hopefully there will come more solutions on how to use it together with Linux, but sadly it seems to come last in the queue of systems who gets real support for it.

Sunday, January 4, 2009

Using the 2GB iPod Shuffle with Linux

Updated 25. May 2009:
Changes:
- Added fstab identifying by UUID

I spent some time figuring out how to do this, but finally found out how it all worked and what had to be done in order for it to worker properly. I am running Debian Testing.
General setup
1.) You need a package called gnupod-tools. If you are running debian as me, install them like this (as root):
apt-get install gnupod-tools
I am also in favor of using a graphical user interface, in my case Amarok.
apt-get install amarok
2.)
Next we are going to add you ipod to your fstab. Here are two methods, the first(Method A) and BEST one is identifying your ipod by UUID. This will save you a lot of problems:
Method A:
First find your players UUID, type
blkid /dev/sdb
This will give you your players UUID. Make sure /dev/sdb is the correct location of YOUR player. Next enter root mode and edit your /etc/fstab:
UUID=YOUR-UUID /mnt/ipod vfat sync, users, auto,umask=000 0 0
Method B:
As root edit your /etc/fstab and add the following line:
/dev/sdb /mnt/ipod vfat sync,user,noauto,umask=000 0 0
Make sure the /dev/sdb is the same as the one your ipod will be discovered as when connecting and create the /mnt/ipod dir. (mkdir /mnt/ipod)
3.) Now connect your ipod shuffle and mount it like this:
mount /mnt/ipod
3.) Delete everything on it
cd /mnt/ipod
rm -rf ./*

and let's make the file system with gnupod:
gnupod_INIT -m /mnt/ipod
Your ipod should now be ready to start adding music on. From here on you can either add them manually in bash or via Amarok. I will teach you how to do both.

Adding music to ipod shuffle in bash
This is pretty easy. All you have to do is use the gnupod_addsong command like this for every tune you want to add:
gnupod_addsong -m /mnt/ipod/ /home/user/My_Music/my_tune.mp3
After you have done this you have to build the library on your ipod by simply typing:
mktunes -m /mnt/ipod/
And eject it properly:
umount /dev/sdb
eject /dev/sdb


Your ipod shall now work properly.

Adding music to ipod shuffle via Amarok
Start up amarok, it shall now find your ipod automaticly. If it doesn't go to "Settings->Configure Amarok" and select "Media Devices". If there is no devices listed click "Autodetect Devices" and your /dev/sdb shall now appear. Now choose to use the "Apple iPod Media Device" plugin for this device. Click Apply and OK. Click the devices button on bottom left. Select the ipod shuffle device, and connect. Add music by dragging it to the list on the left, right click and press "Start transfer" to transfer the music. When you are done quit Amarok, and go into bash and build the ipod library by typing:
mktunes -m /mnt/ipod/
And eject it properly
umount /mnt/ipod
eject /mnt/ipod


Tips 1:
To tweak Amarok and make it easyer to use later, try this:
First let's make a new binary which incorporates a couple of commands when disconnecting. Enter root mode, and edit /usr/bin/ejectpod
Enter the following:
mktunes -m /mnt/ipod
umount /mnt/ipod
eject /mnt/ipod

Save and exit. Chmod /usr/bin/ejectpod to 755:
chmod 755 /usr/bin/ejectpod
Enter Amarok go to Devices and click the configure device button up right next to transfer. As post-disconnect command enter:
/usr/bin/ejectpod
As Pre-connect command enter:
mount -a
OK, and you are ready. Now amarok should hopefully automaticly build the new databases and unmount the ipod when clicking disconnect.

And you are done!

Monday, December 29, 2008

Mini how to use nano in Linux

Open your terminal.
Type "nano" to open the editor or "nano filename.txt" to open and edit a specified file.

Writing - Simply write as you are used to.
Saving - Ctrl+O --> [Enter]
Saving & Quiting - Ctrl+X --> Y --> [Enter]
Find in file - Ctrl+W --> Text to search for --> [Enter]
Go to line - Ctrl+W --> T --> Line to go to --> [Enter]
Find and replace - Ctrl+W --> Ctrl+R --> Text to search for --> Text to replace with --> Y (Replace one instance at a time), N (Do not replace this instance), A (Replace all instances).

Friday, December 26, 2008

Idesktop tweak

Idesktop is in my humble opinion the best desktop tool for linux. In order to make it fast enough I really recommend doing this simple, but effective "tweak". It might not be advanced enough to be called a tweak, but it has sped the functionality up for me at least.

The tweak simply consists of making the desktop icons only need a single click instead of a double click for execution. Since there seems to be no "affirmative" response from the icons when you doubleclick, it is hard to know wether or not the application has been started or not. With a single click setup you allways know it has been executed.

Here's my .ideskrc setup, which works pretty well:
table Config
FontName: verdana
FontSize: 10
FontColor: #ffffff
Locked: false
Transparency: 100
Shadow: true
ShadowColor: #000000
ShadowX: 1
ShadowY: 2
Bold: false
ClickDelay: 300
IconSnap: true
SnapWidth: 55
SnapHeight: 100
SnapOrigin: BottomLeft
SnapShadow: true
SnapShadowTrans: 200
CaptionOnHover: false
end

table Actions
Lock: control right doubleClk
Reload: middle doubleClk
Drag: left hold
EndDrag: left singleClk
Execute[0]: left singleClk
Execute[1]: right doubleClk
end


Hope this helps...