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

March 22, 2016

Moving Mozilla tools from Linux to Mac

To move your Firefox and Thunderbird profile and settings from Linux to Mac. All you have to do is to copy (or create a tarball) the profile. On Linux the profiles are located under:

~/.mozilla/filefox/extentions
~/.mozilla/filefox/<profile>.default
~/.thunderbird/<profile>.default

where <profile> is replaced with your profile name, usually named something cryptic, like: an8e24f4.defaultOnce you have them copied or backed up to your, stick, dropbox, drive account. Or if you copy them using scp. You'll need to place, extract them on your Mac box. On mac they're placed in:

~/Library/Application Support/Firefox/Extentions
~/Library/Application Support/Firefox/<profile>.default
~/Library/Thunderbird/ <profile>.default

Creating a profile with Firefox will help you synchronize your Firefox data. So this kind of copying is not needed again. Unless you're restoring from a backup. And I assume you know the cp/scp/tar commands.

December 18, 2013

And I quote:
Thus, for example, read “munger(1)” as “the ‘munger’ program, which will
be documented in section 1 (user tools) of the Unix manual pages, if it’s present on your system”. Section 2 is C system calls, section 3 is C library calls, section 5 is file formats and protocols, section 8 is system administration tools. Other sections vary among Unixes but are not cited in this book. For more, type man 1 man at your Unix shell prompt.
The Art of Unix Programming.

November 15, 2013

Custom spotify playlists

The problem with spotify and iTunes etc is that there's really no good support for playlists. With playlists I mean importing say csv lists. Why would i need a list like this? Because, every now and then I'd like to just create a simple playlist containing the Artis Name and track number as ARTIST,TRACK repeat.

That's where ivyishere comes in, cool online tool that can export your csv, amongst other, playlists to spotify. Thanks.

How do I get a csv playlist, in this case I found the work of another House MD fan who did spend the time to organize all tracks from all shows on a website. I'd like that playlist without hving to add every single song by hand.

This i what I did.

1. copy the neatly ordered html table using you mouse, from top till bottom, selecting all the songs you like in your playlist.

2. open libreoffice calc and paste the songs there, select the html formatted table and wait.

3. Delete the rows you dont need, keeping only artist and track.

4. Copy the artist and track coloumns paste in a new document, then save this document as csv.

5. Fire up your shell and perl the shit outta a the csv.

cat housemd.playlist.csv  # to see what you have to deal with

Figure out the reguar expressions you'll need, yes you can most likely find a more combined expression than I did, nevertheless my way worked ;)


perl -p -e "s/^,$//g" # Remove the lines containing just ,
perl -p -e "s/^\s$//g" # remove lines containing just whitespaces
perl -p -e "s/^'No.*,$//g" # remove th elines containing the No Commer ... text
perl -p -e "s/\"|\'//g" # remove the ' and " from all artists and songs

The final experssion for me was:

perl -p -e "s/^,$//g" housemd.playlist.csv | perl -p -e "s/^'No.*,$//g" | perl -p -e "s/^\s$//g" | perl -p -e "s/\"|\'//g" > housemd.playlist.2.csv

6. Cat your file to see if it is what you'd expect

7. Upload you file to ivyishere and wait.

Thanks perl and ivyishere.


March 26, 2013

Remote connections

You know the drill! You need to fix a thing at work, a 5 minute thing, but you box was never setup to handle remote connections properly. So fix it, you know you'll need it in two shakes of a lambs tale!

There's a couple of possibilities,  VNC (slower than smoking death!) ssh, and some that run on the remote desktop protocol like XRDP.

Putty & XMing

If you're a Winer, you'll need putty for ssh'ing and a X server, i use XMing. And you'll need to prepare your box if you run Linuxmint Desktop edition.

# sudo aptitude install openssh-server

Then you'll have to allow your remote machine to connect to your box:

# sudo emacs /etc/ssh/sshd_config 

Remove the # comment sign from: ForwardX11 no. Then change no to yes so it looks like this:









ForwardX11 yes



Save and exit. Next you'll have to add you remote machine name to the xhost by:


#xhost +<your ip or machine.domain>

Next you'll have to check that the .Xauthority file in your home folder is owned by your user (mine wasent?) 

# ls -l ~/.Xauthority




-rw------- 1 user user 181 Mar 25 13:35 .Xauthority


If not you should chown it ro your user:

# sudo chown user ~/.Xauthority

You'll now be able to remote connect to your box from any machine with a running x server. Simply start the XServer on your client machine, login via ssh and run the program. In putty you'll have to forward X11 packages, there's a setting called just that.

VNC 

 To use VNC you'll have to install a VNC server on your box, i.e or X11vnc

# sudo aptitude install tightvncserver 

or

# sudo aptitude install x11vnc

The difference is that tightvncserver will serve a new session. x11vnc will allow access to an existing session. That may be what you'll need if you have a running session on your work box.  If you use x11vnc you might want to set a password.

XRDP

Install XRDP and run the deamon.

#sudo aptitude install xrdp

You connect to it by using the Windows remote desktop connection utility. You'll get a new screen, so this utility can't steal your current x session.