Add sub-domains to your server with Apache

11/05/2013 - No comments

    If you have multiple services running on your server, and want to use sub-domains instead of sub-folders, here is a quick howto 😏
    I am running different services on my server at home, for example Shaarli and Leed. Instead of using different sub-folders of the main Apache /var/www/ folder, I preferred to use sub-domains. With sub-domains you obtain something like :
links.domain.com instead of domain.com/links
    To do so, you have to edit a file in the Apache configuration. In Ubuntu, the file is located under
/etc/apache2/sites-availabe/
Open the file named "default" with your preferred text editor and add the following lines at the end of the file
<VirtualHost *:80>
DocumentRoot /var/links/
ServerName links.domain.com
</VirtualHost>
The folder /var/links/ represent the installation folder of Shaarli.
Then, restart your Apache server
sudo /etc/init.d/apache2 restart
open your browser to links.domain.com
Enjoy ✅

Tags : HowTo, Server

Installing RStudio Server on Mac OS X Lion

14/04/2013 - 2 comments

RStudio.png     RStudio is a great IDE for the R programming language. Two versions of RStudio are available, the desktop and the server edition. The desktop edition is a full version running locally and the server edition is running on a server with the graphical RStudio interface accessible from your web browser. At work I am using a Mac Pro as a personal server with all my data and my running scripts. To preserve my memory (RAM) on my laptop I wanted to run R from my server. Until now, I used the command line with ssh, but after testing RStudio I couldn't go back anymore :)
    You can install RStudio Server in any machine and access its graphical interface from any web browser. You will then access your normal IDE running R (on the server-side) with your Rhistory and R plots remaining there.
    Recently, I found the following tutorial about how to install RStudio server on Mac OS X Lion. It works very well, but I got an error at some point. After running the following command
sudo ./install-boost
    I got an error claiming that bootstrap.sh was not found. To continue the installation, you need to run bootstrap.sh by yourself. To do so, run the following commands from your terminal
cd $YOUR_RSTUDIO_INSTALLATION_FOLDER/dependencies/common/boost-build/boost_1_50_0
sudo ./bootstrap.sh
sudo ./bjam --prefix=/opt/rstudio-tools/boost/boost_1_50_0 toolset=clang variant=release threading=multi link=static install
    Of course, change the version of boost if your are using a more recent one. Don't forget to modify $YOUR_RSTUDIO_INSTALLATION_FOLDER by your Rstudio installation folder path.
Then, continue with the normal installation process, everything should go well.
    Browse to http://localhost:8787 login with your username and password you use for the computer where you installed RStudio server and enjoy ;)

image: rstudio.org

UPDATE: Opera is not supported by RStudio BUT works with IE if you install the Google Chrome Frame plugin. OMG :)

rstudioError.jpg

Tags : HowTo, Mac, Server, Software

How to convert PDF to PNG from the command line on a Mac

10/04/2013 - No comments

    Instead of opening your PDF file with the Preview app (or other PDF reader) and export it to PNG, you can easily use the command line.
To do so, you need to use the sips (scriptable image processing system) command installed by default in Mac OS X. Open your terminal and run:
sips -s format png your_pdf_file.pdf --out your_png_file.png
The script also works for the jpeg format the same way.
Voilà ;)

source
 : straylink
A.P. Lawrence

Tags : HowTo, tips

Add tabulations in your articles with Blogotext

07/04/2013 - No comments

    I am using Blogotext as blog engine. It is a big pleasure to use it :) Blogotext is open-source, easy-to-use and very light, it works very well. I would like to thank again Timo for his great job.
    I am using paragraphs to organize my articles and make them clearer. In addition, I like to start each paragraph with a tabulation. Unfortunately, it is not easy to add tabulations using the default Blogotext editor. However, you can do it by forcing 4 spaces, such as
&nbsp;&nbsp;&nbsp;&nbsp;
    I wanted to make it easier, thus I decided to implement this option in my editor.
The default Blogotext editor's menu looks like :
BlogotextEditorWithoutIndent.jpg After implementing the tabulation option, you'll see an "indent" icon in the right-hand side of the "line-through" icon :
BlogotextEditorWithIndent.jpg

    To do so, you will have to modify two lines in two different files:

1 - First,
  • open the file /admin/form.php
  • go to line 581
  • add
    echo "\t".'<button id="button15" class="but" type="button" title="tab" onclick="insertTag(\'\&nb\s\p\;\&nb\s\p\;\&nb\s\p\;\&nb\s\p\;\',\'\',\'contenu\');"><span class="c"></span></button>'."\n";
2 - Second,
  • open the file /admin/style/style-ecrire.css
  • go to line 184
  • add
    #button15 span.c { background-image: url("format-bbcode/edit-indent.png"); }
If you want, you can modify the icon by choosing another one from your /admin/style/format-bbcode/ folder.
Enjoy ;)

Tags : HowTo, Software, tips

Dynamic IP address with OVH

30/03/2013 - No comments


When I was configuring my server, I realized that I only had a dynamic IP address. At the time I had two options:
  • ask for a fixed IP address
  • deal with my dynamic IP address to get it updated when it changes
The first option was too expensive for me. Thus, I decided to go for the second one.

    Some tools exist to allow you to use a dynamic IP address with a specific domain name, such as DynDns or no.ip for example. Those tools provide scripts to update your IP address as soon as it changes. I could't find the free option for DynDns anymore, but there is a free option for no.ip with some limitations, but it should be find for a personal use.
    Before using one of the available general tools, I did some research about OVH (my registrar) and dynamic IP address. I then realized that OVH was providing some specific tools to update your IP information directly on your OVH manager. You can find more information in the DynHOST page.
    I am actually using the Ipcheck.py script available from the previous link. I just had to adapt the script for my own usage. I modified the dynhost script and changed the line
IP=`/sbin/ifconfig $IFACE | fgrep "inet ad" | cut -f2 -d":" | cut -f1 -d" "` 
(which was returning my local IP address)
to
IP=`/usr/bin/wget -qO- ipecho.net/plain`
to get the correct IP address used by OVH.
It actually works pretty well for me, Enjoy cool

Tags : HowTo, Server, tips

Easy way to get your iCloud identifier in Mac OS X

06/08/2012 - 6 comments


     Following my first article on how to add iCloud support to Thunderbird, I found an easy way to get your iCloud identifier on Mac.
To do so, launch the Terminal app (in Applications/Utilities/) on Mac and run
cd ~/Library/Application\ Support/AddressBook/Sources/
ls
Then you will have a number of directories, maybe only one.
If you have multiple directories, you will have to try each of them.
Move to each directories (if multiple) using the "cd" command followed by the name for your directory.
NOTE: you don't have to write the whole name of the directory, just type the first two or three characters and press TAB cool
cd YOUR_DIRECTORY_NAME
then run
cat Configuration.plist | grep "/card/</key>"
which returns something like:
<key>/XXXXXXXXX/carddavhome/card/</key>

the XXXXXXXXX corresponds to your iCloud identifier.
You will need this identifier to add your iCloud calendars and address books into Thunderbird or any other tool. Enjoy.

Tags : HowTo, tips

How to unlock any jailbroken iPhone using SAM

26/04/2012 - 1 comment

samRepository
UPDATE: This method is not working anymore, Apple has patched their activation servers.

     If you have a jailbroken iPhone and you are stuck with the simlock, read carefully the following howto. SAM (Subscriber Artificial Module) is a tool available on Cydia which unlocks any iPhone in any Baseband. To do so SAM is using the original information of the official carrier to allow the activation of the iPhone in iTunes. Here is a very easy tutorial to unlock your iPhone:
  • 1- Installing SAM: to install SAM, go to Cydia and “Manage” in the lower part of the screen.
    • Go to “Sources”, press “Edit” and add the following source: http://repo.bingner.com
    • You should see Cydia installing some packages.
    • Press on repo.bingner.com and install the SAM package.
  • 2- Put the original SIM card in the iPhone, the one to whom it is blocked.
    • Open SAM.
    • Go to Utilities and press “De-activate iPhone”.
    • Go back to SAM main screen and press “General Info”, you should see the state of the iPhone as “unactivated”.
    • Copy the IMSI number under "SIM Details" to the clipboard, press this number, select it and copy, we need this number for later.
  • 3- Put the other SIM card, the one you want to unlock the iPhone for.
    • On SAM select method and choose “Select by Country and Carrier”.
    • Choose the country and the Carrier for whom the iPhone is locked (the one of your first SIM card), and also the ID. If they are multiple ID, you will have to try each.
    • Go to “General Information”, and paste the IMSI number under SAM menu.
  • 4- Attempting activation
    • Go back to the main menu and “Utilities” and press “Attempt Activation”, the iPhone should respring (black screen for a few seconds).
    • After this step you have to disable SAM by turning off “Enabled”.
  • 5- Connect to iTunes
    • Now, you have to connect the iPhone to iTunes and get a popup error message.
    • If you don't have the popup error message but just iTunes saying “the SIM is not valide”, un-plug and re-plug the iPhone until you get the popup error.
    • Click Ok, and reconnect your iPhone to iTunes.
     VOILA, you have an unlocked iPhone. The only point you have to keep in mind, is that the iPhone will only work with the new SIM and is not unlocked for all carriers. You will have to repeat the previous steps to activate other SIM cards. Finally, I would like to thank Sam Bingner for this great job.

     Good luck and let me know if you managed to unlock your iPhones...

Tags : HowTo

How to get a standing ovation at your presentation

09/03/2012 - No comments

toastmasters
     During the SIB PhD Training Network retreat, I had the chance to participate to a talk from Dr. Philip Selby about “Training in Communication Skills”. Philip Selby is a doctor in Medecine (from Cambridge University) and is actually the head of PSA Consulting). Dr. Philip Selby is also a Distinguished ToastMaster (DTM). ToastMasters is a non-profit organization that teaches public speaking through a worldwide network of meeting locations. You can find the closest to your city on the website if you want to join. There are also some very interesting free resources available on their website.
     Here, I summarized the important points about preparing and giving a presentation in case it will be helpful for someone.
Please feel free to follow them smile

General tips
  • The talk should be separated in three parts: the introduction, the body of the talk and the conclusion.
    • The introduction should be clear for the audience, they should know what you are going to talk about.
    • The body should contain a limited number of elements but not too much.
    • The conclusion should emphasis important aspects and remind people of the main points to remember. Be careful not to raise any new point in the conclusion.
  • You can use a visual aid for your presentation. The most famous one is Powerpoint slides (I am using LibreOffice for mines). Be careful not to use too much slides because it will distract the attention of your audience, people should look at you and not your slides. Show slides only when it is really essential such as for diagrams or mathematical equations for example.
  • Keep the time, don't finish after the limit time.
  • Enthusiasm: show that you are very interested in what you are talking about.
  • Know your audience: Take time before your presentation to meet your audience if it is possible or to know who they are. Chatting with people before the talk will give you the impression of doing the presentation for your “friends”.
  • Manage your stress: You can be afraid of giving a talk, it is a very common reaction. The known “symptoms” are sweating (face, hands), palpitations, “butterflies” in stomach and empty brain... but preventive measures exist. To be less stressed 3 points are very important: practice, preparation and relaxation.
    • Practice: practice as much as you can your talk and presentation, always accept to give an in-promptu talk and consider it as an exercise.
    • Preparation: the only key-point is rehearsing.
    • Relaxation: do some abdominal breathing and small exercices.
    To be less nervous, it is good to know the place where you are gonna give the presentation. You can go to that place before the meeting starts to see where people will seat and where you are going to speak. Mental imaging can also help to manage your stress, you can imagine that you are giving a wonderful talk followed by a standing ovation. If you do so, there are more chances that it will happen.
The first impression
  • The first impression you'll give to your audience is very important, because you have only one chance to give a good impression.
  • Your appearance: the appearance depends on your dress. Don't dress worst than your audience.
  • Your voice: try to know how your voice sounds before the presentation, you can ask for feedback from your friends. You can control the volume and the timing of your voice: don't speak at the same speed or same volume and don't be monotonous. Be careful of the articulation when speaking to a multicultural group, different nationalities or to people with different languages background. Make a pause after something important, let the audience digest what you said. With pauses, you will give to the audience the impression of anticipating what is next. Some people are saying "eee" or "mmm" a lot while speaking, you can try to say nothing (make a pause) instead.

The body language
  • More than half of the communication is non-verbal. How you appeared to your audience will affect your presentation. Don't lean on a chair, seat on a table or keep your hands on your pockets. Take care of your posture. Do a little bit of movements and some gestures, it helps to reinforce what you are saying and emphasis the point that you are making.
  • The facial impression is crucial: some people smile a lot when they are nervous (even when the topic is not hilarious).
  • The eye-contact: Difficult when there is to much people. In that case do it with different people in different places. Don't look down or up to the audience. With eye-contact you can see what people are doing, you have indirect feedback. If they are smiling, they are enjoying and are with you. Be careful, eye-contact doesn't mean scanning.
  • Mannerisms: repetitive movements the person is not aware of, for example swaying.

Responding to questions
  • How you respond is very important: listen each question carefully and repeat the question to make sure you really understood. While answering, focus on the questioner.
  • The reply should be as succinct and relevant as you can, don't give more information than the question.
  • If a question is too long, choose a specific point of it.
  • If you don't know the answer: don't invent something or don't make a guess. You can refer the question to the questioner like: "what do you think about it ?", "I don't thought about that, is there anyone in the audience who want to answer ?", or " I don't know I will look at it and send you an email".
  • If someone wants to obsess you, this people is not interesting in getting an answer, he/she just wants to tackle you. Don't get to a fight, you will loose. Be very diplomatic and polite, try to answer as best as you can.
  • If time is not enough: take one last question, don't prolong the situation. Use the last question to put on your last remark.

Tags : HowTo

Integrating iCloud into Thunderbird

17/02/2012 - 6 comments

thunderbird
     Apple released a few months ago the latest version of the iDevices operating system iOS5. Among the different new features, iCloud was one of the most important. iCloud keeps all the iDevices and Mac computers synchronized for calendars, reminders, contacts, bookmarks... It also supports iDevices backup on the cloud.
     I am using iCloud since two months now, I like the idea of being synchronized everywhere, the calendars and reminders are very useful for me. I can find everything synchronized in my iPhone and my MacBook. You can access all your information at www.icloud.com and from your device using the existing applications such as iCal, Address Book or Mail for example. I don't like to use many different softwares when I can have everything at the same place from the same tool.
     I am using Thunderbird for a while now. Thunderbird is an open-source mailing application from the Mozilla group (the same as Firefox). Thanks to the incredible and always increasing number of add-ons, it is possible to easily extend the possibilities of Thunderbird. Here, I will explain how to use Thunderbird (I am actually using mac version 9.0.1) to access your iCloud mails, calendars, reminders and notes. The access will be read and write, so you can modify any element from Thunderbird or your iDevice and it will be synchronized in your iCloud account.
     To do so, you have to know the addresses of the iCloud servers you are using. For this step we will use an existing script from NiftySide. You can find this script here - please donate if you found the script helpful. By following the different steps, you will obtain the addresses for the servers you are using in iCloud. We will use these addresses into Thunderbird.

iCloud Mails and Notes
     I have a mail address using the @me.com domain. To add your iCloud mail account into Thunderbird create a new email account with the following information:
Imap server: p02-imap.mail.me.com
Username: Your name before @me.com
Smtp server: p02-smtp.mail.me.com
     You can then access all your iCloud mails and notes within Thunderbird.

iCloud calendars
UPDATE: In recent version of Thunderbird (14+) you don't need to modify the calDavRequestHandlers.js file, the code should be already adapted to support iCloud calendars (see post comments).
Install the Lightning add-on in Thunderbird. You can download it here or directly from Thunderbird using the Tools/Add-ons menu.
     1 – Add a new Network calendar using the CalDav protocol
     2 – Use the address of your calendar you obtained from the previous script
     3 – Finish by choosing a color and a name for your calendar (you can use a different name than your phone)
     You can see your calendar on the list and you will probably access it only for a short moment smile To use the calendar correctly, you have to modify a configuration file. Don't worry it is not a big deal. You have to add some modifications on the following file:
/Users/[username]/Library/Thunderbird/Profiles/[$code]/extensions/[$code]/calendar-js/calDavRequestHandlers.js
for $code, you have to find which one correspond to your iCloud calendar if you have multiple calendars.

     4 – open the file with your preferred text editor (Aquamacs for me)
     5 – Add the following code at the exact line number 580 (respect the indentation)
    if (!r.getcontenttype &&
        r.href &&
        r.href.length >= 4 &&
        r.href.substr(r.href.length - 4,4) == ".ics") {
        // If there is no content-type for the resource but its name
        // ends with ".ics" assume the content type to be
        // text/calendar. Apple iCloud interoperability fix.
        r.getcontenttype = "text/calendar";
    }

     6 – Add the following code to the line 609
    r.status.indexOf(" 200") || // Apple iCloud returns 200 status for each item
     7 – Save and close the file
     8 – Restart Thunderbird and enjoy
     We need this workaround because of the specific extension of iCal calendars. Now, Thunderbird recognizes the extension .ics as a calendar. You can also add your reminders by following the first 3 steps and using the corresponding iCloud server address. If you have any question or remark don't hesitate to contact me.
     Unfortunately, I didn't find any add-ons for the CardDav protocol to synchronize my contacts. I can access my Mac address book within Thunderbird but cannot modify it, the access is read-only.
     I really like iCloud and the cloud in general but of course I would prefer something more open. I recently discovered OwnCloud and I am actually trying it. I am planning to discuss about OwnCloud in another post.

Tags : HowTo

Using JabRef references in Word documents

30/01/2012 - 7 comments

jabref

     Due to my actual position as PhD student, I often need to write documents with references and bibliography. These documents are shared among the group members and the professor for corrections and feedback. Thus, I have to write the document and its corresponding bibliography in a way that anybody can read and modify it.
     To organize my bibliography I am using JabRef, which is an open-source and free reference manager. I really like the graphical interface, it is user-friendly and easy-to-use. An interesting option is to search online databases for references using the “Web Search” menu. Found references can be added to the bibliography with one simple click. JabRef allows users to export the bibliography in many different format such as sql, txt, csv... The best option for me is the “BibTex Source”, which generates a key to use with documents in Latex format. Until now I always used the .bib file which I included in my latex version, the best combination :) Latex outputs a document in PDF or HTML format. Unfortunately, these are not easily editable files for anybody.
     In our group Microsoft Word is the most commonly used text editor. Thus, I have to write my documents using Word, and generate my bibliography using a Word compatible tool. The most famous reference manager soft well integrated in Word is EndNote. EndNote is automatically integrated in Word but unfortunately it is a very expensive and not open-source software. The point is that I have to use Word to write my document but I want to keep JabRef for my bibliography. After some researches on the net and many failing tests, I finally got JabRef bibliography working in Microsoft Word.
     In Word, it is possible to add a new Reference manually. When a new reference is added, Word save it into a file in xml format. This file is located under “Microsoft User Data” in Mac and named Sources.xml. The good point is that JabRef can export bibliography in xml format, but cannot integrate it directly to Word. The following steps will help you to use your JabRef bibliography into Word documents:

1 - Export your JabRef bibliography in xml format
2 - Name the file Sources.xml
3 - Locate the original Sources.xm file at ~/Documents/Microsoft User Data in Mac (it should be something similar in Windows and Linux)
4 - Rename the Sources.xml file to Sources_Backup.xml
5 - Move the Sources.xml file from JabRef to ~/Documents/Microsoft User Data
6 - Enjoy your new bibliography in Word

     You then have to choose from the list the references you need for your document. To do this go to the References Manager in Word and click on Manage. You can access the “Citation Source Manager” with the button on the bottom-right of the “Citations” window. You can then copy all the references you need for the current document from the “Master List” to the “Current List” and use them into Word. You can finally add your bibliography at the end of the document using the References → Bibliography option.

Tags : HowTo


≺ newer elements – older elements ≻