Accéder au contenu principal

Articles

Setting up Rust on Windows 10 with MSYS2 without installing Visual Studio

Setting up Rust on Windows 10 with MSYS2 without installing Visual Studio  1. Install MSYS2 2. Update MSYS2 and run : pacman -Sy && pacman -Syu  and install git and gcc: pacman -S git &&  pacman -S mingw-w64-x86_64-toolchain 3. Open the MSYS2 terminal and install the rust compiler with :  pacman -S mingw-w64-x86_64-rust You may stop here but you will miss the rustup package (which is not part of MSYS2) to manage the Rust compiler environment. To install rustup , follow the next steps. 4. Clone the rustup git repository :  git clone git@github.com:rust-lang/rustup.git --depth=1 5. Compile and run rustup: cd rustup cargo run --release 6. Once rustup detects the previously installed rust compiler and asks to uninstall it before you can continue. So, open a new MSYS2 terminal and uninstall rust :  pacman -R mingw-w64-x86_64-rust 7. Now back to the rustup terminal, choose yes to continue the installation. On the next question choose : custom ins...

Installing Tensorflow with GPU support on Ubuntu 16.04

Installing Docker for running learning resources (eg Udacity MOOC) 1. Head to the Docker installation webpage and install Docker https://docs.docker.com/engine/installation/linux/ubuntulinux/ 2. If you have a large second HDD, you might want to make sure all the docker images you use are stored on the large disk to preserve your precious SSD space. For this, I found that creating a symbolic link to a new location on the second hard-drive disk worked best for me.   a. Make sure that the large hard drive disk is mounted automatically when booting the disk https://help.ubuntu.com/community/Fstab   b. Setup a symbolic link to a directory inside your large hard drive disk. Setting   DOCKER_OPTS  did not work for me, but the symbolic link method worked: https://forums.docker.com/t/how-do-i-change-the-docker-image-installation-directory/1169 Installing Python Anaconda 1. Follow the instructions here https://www.continuum.io/downloads 2. Download this pyt...

Installing Ubuntu 16.04 on an Alienware Aurora R5

Installing Ubuntu 16.04 LTS on an Alienware Aurora R5 with NVIDIA GPU support (Dual boot Windows) I have compiled these instructions from my succesful installation on Nov 25. Would you be happy to live without Windows? If not use Dual Boot. This procedure is inspired from this DELL support page : http://www.dell.com/support/article/uk/en/ukbsdt1/SLN301754/en You can refer to the link above for additional steps and to see useful screenshots. However, please, make sure to take care about the GPU-related  steps below. Re-installing Windows 10 with BIOS Secure Boot to OFF First, check that have only one disk installed in your machine. I have found that having one disk only makes it easier to re-install Windows. Secondly, an important step is to create two USB Recovery disks. Use two USB memory sticks bigger than 16 GB supporting the USB 3.0 standard (file copy will be much faster). Use the first one to create a recovery disk for Windows 10, as a backup if the instal...

How to create an executable from a Scala project

I started to have fun with scala and I wanted to be able to package and launch a Scala executable. It is an eclipse project and it is already using Maven for dependency resolution. I found the following solutions (to confirm) 1. Use SBT as a build tool. SBT seems to support the Maven pom.xml files for dependency resolution. 2. Use Gary Boone's solution by wrapping the Scala project entry point into a Java static main function 3. Use mvn assembly : single plugin as described on stackoverflow

Use Python to login to a secured website

This Python 2 class logs in and connect to a secured website. The class inherit from thread so that it is possible to run multiple instance of the class. class CRReader(threading.Thread): data = None headers = None def __init__(self, crNo, semaphore): threading.Thread.__init__(self, name=crNo) self.loggedin = False self.crNo = crNo self.semaphore = semaphore self.opener = None self.status = None def login(self): if self.loggedin is False: #print 'Login ' + self.crNo url = "https://example.com/login.php" opts = { 'username': 'John', 'password': 'pass1', } CRReader.headers = { 'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12', 'Accept': 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5', 'Accept-Language':...

/etc/X11/xorg.conf

#To setup bigger resolutions with Ubuntu in a Virtual Machine #Section "Device" #Identifier "VESA Framebuffer" #Driver "vesa" #VideoRam 4096 # Insert Clocks lines here if appropriate #EndSection Section "Device" Identifier "Configured Video Device" #Driver "vboxvideo" EndSection Section "Monitor" Identifier "My Monitor" HorizSync 31.5 - 150.0 VertRefresh 75-85 EndSection Section "Screen" Identifier "Screen 1" Device "VESA Framebuffer" Monitor "My Monitor" # If your card can handle it, a higher default color depth (like 24 or 32) # is highly recommended. # DefaultDepth 8 # DefaultDepth 16 DefaultDepth 24 # DefaultDepth 32 # "1024x768" is also a conservative usable default resolution. If you # have a better monitor, feel free to try resolutions such as # "1152x864", "1280x1024", "1600x1200", and "1800x1400" (or whatever ...

iPhone Email Hack for data retrieval

I wanted to send an email I typed in my iphone from a cybercafe without wifi access. I just setup a adhoc wifi network and sshfs the whole file system. For ssh setup, see my previous blog post. I discovered that email are clearly stored in : /private/var/mobile/Library/Mail And emails are stored as .emlx files. To read those files use a mail client just like thunderbird or use a simple text editor. You can use a base64 decoder to decode encrypted message part when necessary.

With an iPhone jailbroken ios 4, how to setup tethering with ssh for free

Free tethering on iPhone with jailbroken IOS 4.0.1 and Ubuntu Linux. That is also possible on windows with putty. I. Preparing the operation, setup of the necessary programs 1. Install openSSH with cydia then reboot the iPhone 2. Install sshfs to browse all the iphone files easily (sudo apt-get install sshfs) 3. Download the fixed terminal (step not necessary) http://code.google.com/p/mobileterminal/downloads/list which is useful for changing the default password right on the iphone. 4. Get the iphone address in the wifi settings (let's say it is 192.168.0.101) 5. Using sshfs, mount the iPhone filesystem : mkdir myiphone && sshfs root@192.168.0.101:/ myiphone 6. Copy the unziped Terminal application in /var/stash/Applications folder of the iPhone filesystem then reboot the iPhone 7. Change the default password (alpine). See : http://iphoneoverdose.com/2008/how-to-change-the-default-alpine-ssh-password-on-your-iphone/ II. Tether now! 1. Create an AdHoc connection on Ubuntu w...

Toshiba NB 200

It's 2009, I've acquired a brand new TOSHIBA NB 200 NetBook. The first thing i did : install Ubuntu 04.09. I had hard time to setup the wifi, but finally, i succeded. I have wireless internet now with my netbook! My wireless card is an Atheros 9285. Just followed the procedure described in the page : http://wireless.kernel.org/en/users/Download And it worked like a charm. 1. Dowload 2. Compilation 3. Installation 4. Reboot 5. Connexion via ubuntu GUI Update, it's 2016, now, I have restarted my netbook which now uses Ubuntu 14.04. Problem, the sound does not work. This is how I fixed it using the advice from this forum page : sudo apt-get install alsa-base sudo apt-get install pulseaudio sudo gedit /etc/modprobe.d/alsa-base.conf then add at the end of the file: options snd-hda-intel model=auto

Home network, IP adress behind a router, how it works?

If you're using a router to access the Internet, then, maybe, you have noticed that your computer IP address is not the same seen from a computer or server outside your local network. Your router is hiding your local adress and permit the sharing of one single access to the Internet. How is it working? The router uses a technique named NAPT (Network Address Port Translator). NAP ... What? Typically, several computers are linked to one router in a Small or Home Office (SOHO). This router has only one IP address and is providing this single access to the SOHO computers. Let's say that, in fact, SOHO is Pr. John Doe's local network. Pr. John Doe has one nice black and silver brand new laptop featuring a huge hard drive disk and the latest processor. He owns as well, one slow and an old dusty computer he uses from time to time to browse the net. Let call the first computer, computer B like Brilliant and the second one, computer C like Crappy. A is the name of the router. Compu...

Sockets

For a software engineer, a socket is a network interface. Programs talking to each other are sharing the same thread. There are two communication modes : connected : Stream Sockets unconnected : Datagram Sockets In connected mode, the excellent quality of transmission is achieved using TCP . Web browsing with HTTP, for example, is actually using TCP. TCP is informationlossless! The information reach the final destination in the original order and no data is lost. The protocol used by Datagram Sockets is UDP. A packet retrieving information must be implemented.

A discussion about "delete this" in C++

To test your C++ programming experience and curiosity, a pop quiz question could be : what can you say about the C++ expression "delete this"? In C++, "this" keyword is used in object member functions and is a pointer to the curent object. As a beginner, the answer seemed to be obvious to me: how the language can allow an object to commit suicide? Impossible, I thought. However, it's possible to "delete this". Deleting the current object does not cause compilation errors. Although "delete this" is accepted by compilation, its usage can lead to logic errors. Indeed, if this suicide is absolutely necessary, the following rules must be observed: 1. The object must be created via dynamic allocation using new operator. 2. No member function of the object is invoked on "this" object after suicide. 3. No member object of "this" object is called after suicide. 4. Nothing will use "this" object after suicide. P...

Begginners : How to learn VHDL!

VHDL is one of the most Hardware Description Language used. This Description Language has many advantages over the others: VHDL has powerful synthesis functions allowing a strong and friendly design reuse methodology. This single advantage is so strong designers should not look aside. Good digital designs are generic a parameterizable. They are easy to maintain, reuse and help to produce complex system quicker. So, How to learn VHDL? 1. Learn Boolean algebra/ Boolean logic This will give you a better comprehension about the logic of a digital circuit and an overview on how computation is done on basic circuits. http://en.wikibooks.org/wiki/Digital_Circuits 2. Learn Finite state machine and Sequential Logic. http://en.wikipedia.org/wiki/Finite_state_machine Those two notions are absolute prerequisite to start coding in VHDL. This done, you can start a VHDL tutorial and then you're ready for the next chapters.