Profile cover photo
Profile photo
Sergi Faber
96 followers -
freelance web developer
freelance web developer

96 followers
About
Posts

Post has attachment
i3-gaps with konsole and bumblebee-status. Slackware64-current, i3wm & KDE apps is the combination that works best for me!
Photo
Add a comment...

Post has attachment
First attempt at ricing i3-gaps. There's still work to be done!
Photo
Add a comment...

Post has attachment
i3wm is by far the best wm I've ever tried. Everything makes sense and work is fluid. I'm very happy so far with it.
Photo
Photo
16/11/16
2 Photos - View album
Add a comment...

Post has attachment
Lumina desktop 1.0.0 for Slackware current.

#Lumina   #LuminaDesktop   #Slackware  
Photo
Photo
Slackware
2 Photos - View album
Add a comment...

Post has attachment
+Slackware current with +Eric Hameleers KDE5 and Antü icon theme. Clean desktop.
Photo
Photo
2016-09-30
2 Photos - View album
Add a comment...

Post has attachment
KDE 5_16.01 for Slackware-current (thank you +Eric Hameleers) with the great +Fabián Inostroza's 'El General' icon theme. I asked him to add a Slackware application launcher icon and he kindly agreed, as you can see.
Photo
Add a comment...

Post has attachment
Finally in Barcelona!
Photo
Add a comment...

Post has attachment
My new clean desktop: #KDE 4.14.3 from #Slackware current, Descartes Breeze Window Decoration, Produkt Theme, FaenzaFlattr icons and my own wallpaper (Aiguamolls de la Deu i la Moixina, la Garrotxa, Catalonia)
PhotoPhotoPhoto
2015-05-02
3 Photos - View album
Add a comment...

Today I had to convert a legacy website, database and files, from ISO-8859-1 to UTF-8. It was easier than I expected. Here's how I did it with find, iconv, sed, python and MySQLdb:

# Converting a website from ISO-8850-1 to UTF-8

## The files (html, css, php…):

With `find` and `iconv` it was really fast and easy:

$ cd websitepath
$ mkdir UTF-8

$ find . -name "*.php" -exec iconv -f ISO-8859-1 -t UTF-8 "{}" -o UTF8/"{}" \;

Do the same for every file extension (.html, .css) in every directory.

It could be improved with some more bash to do this automagically.

## Change the charset in the files:

$ find . -type f -exec sed -i 's/iso-8859-1/utf-8/g' {} \; 

## The MySQL database: I used python with MySQLdb:

~~~python
#!/usr/bin/python
# -*- coding: utf-8 -*-

import MySQLdb
db = MySQLdb.connect(host="localhost", user="user", passwd="password", db="dbname")
cursor = db.cursor()

cursor.execute("ALTER DATABASE dbname CHARACTER SET utf8 COLLATE utf8_unicode_ci;")

cursor.execute("SHOW tables")
Tables=cursor.fetchall()
for table in Tables:
    cursor.execute("ALTER TABLE %s CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;" % (table[0],))
~~~

Job done! Enjoy!
Add a comment...

Post has attachment
My own Pandoc editor with live preview. I have finally used codemirror http://codemirror.net/ instead of the former simple textarea and it was clearly the right decision!  It's just a quick experiment but it gets the job done! #pandoc
Photo
Photo
2014-12-03
2 Photos - View album
Add a comment...
Wait while more posts are being loaded