YORIK’S COFFEE CORNER

Hi, this is my blog, and also a guestbook. I publish stuff I do from time to time. Be welcome and feel at home, have a coffee and don't hesitate to drop me a line or two. All languages are highly welcome, especially the most exotic ones (nederlands, bij voorbeeld...).

You are currently viewing only posts tagged as opensource in this guestblog for this year only.

Click here to retrieve posts with same tag from other years as well.

Click here to go back the blog home page, or browse by tag: linux, opensource, blender, freecad, 3d, works, animations, architecture, projects, detail, sketches, bede, photo, webdesign, wordpress, idsampa, inthepress, cooking, trilhas, orange, Architecture, or search the 2012, 2011, 2010, 2009, 2008, 2007 or 2006 archives.


in categories  linux  opensource  permalink:  249   posted on 07.04.2013 17:06
From Yorik

Retrieve a file via ftps + mysql backup


This is a note to myself, so I remember later, since the syntax is a bit complex and you need several variable settings (they can also be set in ~/.lftp):
lftp -e "set net:timeout 10; set ssl:verify-certificate no; set ftp:ssl-protect-data true;
get mydir/myfile.sql.gz; bye" -u myusername,mypassword ftp.myserver.com

You can use that to make automatic backups of a mysql database, by adding a line like this to your webhosts cron list:
/usr/bin/mysqldump -u myuser --password=mypassword databasename | /usr/bin/gzip >
/home/user/htmldir/mydir/myfile.sql.gz

in categories  linux  opensource  permalink:  228   posted on 17.03.2013 3:50
From Yorik

You spend too much time in front of the computer


and you want to know how much, or maybe you simply want to know how long you have been working on something today. For either cases, I made this little script for linux, that you must launch at startup (put it in your startup apps list, or launch it manually). It will then record the time passed since you turned on your computer, and subtract the time your desktop was in screensaver mode, resulting in the time you were actually sitting doing something with the computer.

Of course it wont help you to know how long you have been working and how long you spent staring at facebook. But there are much better time-logging apps available on the net to solve that problem...

The script will store the current activity time in a ".activitytime" file inside your home folder, so you can just do "cat ~/.activitytime" from a terminal or from any other script (launcher, panel widget, etc...) to display your current activity time.
#!/usr/bin/python

import sys,os,time

r = os.system("xprintidle")
if r != 0:
    print "Error: xprintidle was not found, and must be installed for this program to run"
    sys.exit()

total_idle = 0

def uptime():
    "returns uptime in minutes"
    with open("/proc/uptime", "r") as f:
        uptime_seconds = float(f.readline().split()[0])
        return int(uptime_seconds)/60
    return 0

def idletime():
    "returns idle time in minutes"
    global total_idle
    r = os.popen("xprintidle")
    idle_minutes = int(r.read())/60000
    if idle_minutes > 1:
        total_idle += 1
    return total_idle
    
def formattime(minutes):
    "formats atime in minutes to HH:MM"
    hours = minutes/60
    restminutes = minutes%60
    return str(hours).zfill(2)+":"+str(restminutes).zfill(2)
    
def writetime():
    "writes current activity time to a file"
    strtime = formattime(uptime() - idletime())
    print ("active time: "+strtime)
    fil = open(os.path.expanduser("~") + os.sep + ".activitytime","wb")
    fil.write(str(strtime))
    fil.close()
    
def readtime():
    "reads a temp file and adjusts elapsed idle"
    global total_idle
    fpath = os.path.expanduser("~") + os.sep + ".activitytime"
    if os.path.exists(fpath):
        fil = open(fpath,"r")
        r = fil.read()
        fil.close()
        t = r.split(":")
        minutes = int(t[0])*60 + int(t[1])
        print "logged activity time: ",formattime(minutes)
        print "current uptime: ",formattime(uptime())
        total_idle = uptime() - minutes
        print "logged idle time: ",formattime(total_idle)

if __name__ == "__main__":
    if len(sys.argv) == 1:
        # if no argument is given, start from zero
        writetime()
    else:
        # with an argument, for ex --append, restart from currently saved time
        readtime()

    while True:
        time.sleep(60)
        writetime()

in categories  linux  opensource  permalink:  225   posted on 05.03.2013 24:03
From Yorik

Recompile a Ubuntu PPA package on Debian


One of the annoying things with Ubuntu PPAs is that they almost never install out-of-the-box on Debian, because usually they need a too new version of a package or a too old one, depending on which Ubuntu version you choose.

Fortunately, since both Debian and Ubuntu share the same package system, so recompiling and repackaging a PPA package is often very easy, since the source code already comes ready for packaging. Here are the steps to follow :

1. Install build-essentials and dpkg-dev packages

2. On the PPA page on Launchpad, click the "view package details" link and expand the most recent version.

3. Download both the tar.gz and the .dsc files (the source code and the debian package specification)

4. Place both in a same folder, then extract everything:
dpkg-source -x name-of-dsc-file.dsc

5. Go to the extracted folder:
cd name-of-folder

6. Compile the code:
dpkg-buildpackage

7. If some needed package dependencies are not installed, the above command will abort now and tell you what is missing. Correct the situation and run dpkg-buildpackage again. Compiling might take some time.

8. Is all went well, you will find one (or more, since the dsc file might have instructed to split into several packages) .deb files in the folder that contains your dsc file. Install it by double-clicking it in your file manager or with:
sudo dpkg -i name-of-package.deb


Retrieved and adapted from http://www.cyberciti.biz/faq/rebuilding-ubuntu-debian-linux-binary-package/

in categories  opensource  blender  permalink:  217   posted on 21.02.2013 22:33
From Yorik

Blender cross section script ported to 2.6x


This was long, long overdue, but the cross section script I and a couple of others wrote for blender 2.49 has finally been ported to 2.6x, thanks to the efforts of @Ejnaren who did most of the job.



The script works basically the same way as the 2.49 version, you select objects to cut, then (as the last object of the selection) a planar object (it must contain only one face) that defines your cut plane, and press the button. The controls - once the addon is installed - are in the tool shelf, and there is an option to fill closed paths with faces, like in the example above.

The addon is currently available via the blender project tracker or directly from here.

in categories  freecad  opensource  permalink:  206   posted on 07.02.2013 18:47
From Yorik

FreeCAD plans


The 0.13 release of FreeCAD is being prepared and is almost ready (we are now uploading sources everywhere and building packages), so this is a good time to plan a little bit what I will be working on next...

General
  • Switch our wiki, mantis and phpbb to self-hosted
  • Try to achieve python3 compatibility, so we can have blender-in-freecad or freecad-in-blender again (basically import freecad files in blender and vice-versa)
  • Try to make standard icons use the current qt theme

Draft module
  • Separate upgrade and downgrade tools into smaller parts, to make them more extensible / configurable, and easier to fix bugs
  • Make upgrade and downgrade available in scripts (put them in Draft.py)
  • Turn the Draft snap icons into FreeCAD commands
  • Redo the dimension tools, simplify them (solve the orientation hell), use a placement, see if it is possible to base their coin node on Lukes sketcher dim node

Arch module
  • Better IFC import, get rid of internal parser if possible (keep it as a separate option), try to support IFC objects subcomponents (base polyline, separate shape representations, openings) if available
  • Better struct tool, allow placement, to choose base profile, etc
  • Add IFC export (add python bindings to IfcOpenShells exporter)
  • Add materials
  • Explore the concept of space, an empty volume limited by walls, floors, ceilings or anything else. Ideally have a two-way link between the space and its bordering elements (a space is defined by its borders, but changing the dimensions of a space could or should move its borders... seems difficult to achieve)
  • Explore the concept of floors, basically be able to calculate floor areas of a project. Maybe relate to spaces, but spaces might not always have a floor area...
  • Explore the concept of multilayer objects, typically walls. Many complications arise, such as capping, corners and openings...

More about what I plan for walls here

Spreadsheet module
  • Basic spreadsheet object
  • Basic spreadsheet viewer
  • Basic spreadsheet view (group of cells)

Drawing module
  • Allow the webkit viewer to draw a page background when viewing an svg file
  • Try to use the webkit viewer instead of the qsvg viewer. AFAICS main thing needed is signal-slot to update the contents.


If you want to keep updated with what I do there, check my assigned issues on the issue tracker

in categories  linux  opensource  blender  permalink:  201   posted on 18.01.2013 15:41
From Yorik

About Clevo, Avell, Debian and Cycles





I got myself this new toy: An Avell G1511 notebook. It is a very good machine, with a recent generation I7 CPU, an Nvidia GTX660m GPU with a 1920x1080 display, and an hybrid HDD+SSD hard drive, which boots debian in less than 7 seconds from grub to fully loaded desktop.

This notebook is what is called a "barebook", or "whitebook", or "barebone notebook". It is actually a Clevo W350, which sells with only the shell, the motherboard and the GPU. The guys at Avell add the other components (Avell only sells in Brazil, but there are similar brands in the USA and in Europe, like Sager or Schenker, more here ). As a result, it is very configurable, and you can choose between many types of CPUs and hard disks. You can even choose the color of the shell... And a very remarkable detail, all Avell notebooks have a 3-year warranty.

There is quite some time I wanted to put my hands on such a barebook, and it is really a very good machine. First advantage is the very low price, a notebook with the same setup costs about the double if it comes from Dell/Alienware or Asus, and triple if it is a Mac... Basically you can get yourself a pretty powerful machine at the cost of a very mid-range one. The I7 + GTX660 allows you to run any recent game, and the 2 games I installed until now (Oil Rush and Serious Sam 3) both run with all settings at maximum in 1920x1080...

I also discovered that between all notebook vendors, only Asus makes its own shells. All others (Dell, HP, Sony, etc...) also buy their shells from a third-party manufacturer. So not only there is no difference with Avell/Clevo, but also Clevo is a very well-known one, and really the W350 shell is excellent: It is solid and the thermal design is very good. The ventilator can spin quite hard when doing CPU-intensive jobs, but doesn't even need to run when gaming in high-resolution... And the design is actually far from ugly, differently from what I expected...



Since this notebook comes without operating system, I started by installing my favourite operating system, debian (testing release). I made a coupe of technical questions to Avell before buying and the guys were very professional, they dug all the answers I needed, etc. Even so, I wasn't sure some smaller parts would work out-of-the-box. Good news, 100% of the hardware is supported. Not totally out-of-the-box, though, but everything was very easy to solve. Basically I had to do this:
  • The Ivy-bridge architecture this I7 CPU is based on is only well supported from kernel 3.6. Debian testing ships with 3.2, which makes the system freeze from time to time, but 3.7 is available form the repos, so it is very easy to fix
  • The Nvidia GPU is an Optimus-based one (a system to switch automatically between the I7 integrated GPU and the Nvidia one, to save power), and optimus is still not officially supported on linux (Fuck you Nvidia! said Linus Torvalds about that problem). Fortunately, the opensource community came with a solution that is now extremely stable, and I would say almost better than the official driver, called bumblebee, and its new indispensable add-on called primusrun. On Ubuntu all this is easily installable via PPA, on debian you need to compile them yourself, but if you use debian, you surely like to compile stuff yourself... With bumblebee and primusrun, you simply force any application to use the Nvidia GPU, while the rest runs on the I7. The performance is smooth and perfect.
  • All the peripheral hardware is from Realtek. The network adapter works out-of-the-box, the wireless adapter not, but already has a linux driver available from realtek, which you can compile yourself now, but will be included in the kernel 3.8, and the card reader needs an additional package called rts-bbp.

After that, everything runs perfectly. I like to use debian testing because you can install it bit by bit, starting from a very bare minimal installation, and add pieces as you need them. Definitely debian is not a distribution for you if you don't like to configure your own stuff. Only to make a bootable USB stick you need to read several instructions pages... But on the other hand, you end up with a blind-fast system, where you know every piece and every process.



After the system was up, one of the most important things I wanted to test is Blender's GPU-enabled renderer, cycles. I compile blender myself (I can't wait to get the new features), and fortunately, at this date, all the dependencies you need are in the debian repositories (except opencolorio and opencollada, but they are both optional). You must just be very careful to get all the Nvidia stuff (nvidia driver, cuda libs and cuda toolkit) with the same, matching version numbers (in my case they come all from the debian experimental repo, driver 313.18 and cuda 5.0), otherwise Blender won't detect your card. And you don't even need bumblebee to run cycles!

Much has been said (specially by our friend Ivan ) about Nvidia 600-based GPUs and their poor performance in cycles (namingly, even being more recent, they behave much worse than 500 series). This proves out to be quite true unfortunately, the Mike Pan's BMW benchmark renders in 3'06" (against 3'20" when rendering with the CPU), and on the benchmark page you see older GPUs rendering the same scene in about 1 minute.

But there are several other considerations to take into account: The Nvidia 600 series (also called Kepler) is pretty new, so cycles might still not use them with full potential (cycles is still in heavy development), and benchmarking sites usually place the 600 series quite above the 500 series, so they perform better in other areas (gaming especially). This is also because they use a much faster memory than the 500 ones. And my notebook is not meant to become a cycles rendering node, we always use render farms for heavy work. And, as Saint Mango teaches us, life is meant to do hard work and play good videogames in equal parts...