Laur IVAN

Copy File from Local Desktop to Remote Resktop Connection

Posted by in IT

TL;DR: Drag-and-drop doesn’t work. Copy&paste does! Before yesterday, my way of moving files between my local desktop and a remote one using MS Remote Desktop Connection involved a 3rd party service like Dropbox or email. Then, a kind soul took pity on me and showed me the proper way. In his words: Drag and drop doesn’t work but copy/paste does. Simple, but veeerrryyy effective! Note I’ve only tried this so far between 2 MS Windows machines, with some large-ish (30M) files. A little experiment: If you find this post and…read more

Use Git Bash as Integrated Terminal in VS Code

Posted by in Software, Tutorial

TL;DR:: Install windows git to get bash and add “C:\\Program Files\\Git\\bin\\bash.exe” to “terminal.integrated.shell.windows” in VS Code’s user settings. As I’m trying my hand at developing a node application today, I’m getting frustrated by the Terminate batch job (Y/N) every time I need to restart a script: Since previously I was developing on linux/macOS, I’m used to bash and I figured that it would be nice to have the bash shell in VS Code’s embedded terminal. One of the painless ways to have bash on your system is to install git…read more

Migrate Chromium and Keep all Settings

Posted by in IT, Tutorial

TL;DR: Backup App Data\Local\Chromium on your old machine, copy it to your new one and uncompress (in the same place), install Chromium, profit. With the migration to a new computer, I’ve managed to keep all my Chromium settings. The steps I did are the following: On the old computer Note the chromium version you’ve installed Go to App Data\Local Archive the Chromium directory Note: this might be huge! To reduce it, clean the Chromium\User Data\Default\Cache Note the plugins (optional) – this might be useful if you have plugins depending on…read more

Find Where Your Network Drives Map to

Posted by in IT

The other day I was at home in a somewhat odd situation; I had a VPN connection but I could not, for the life of me, remember the mappings of the network drives from the other side. Also, of course there was no documentation how to do it. A kind soul showed me how to do it in windows. On your work computer, perform a net use. You should get something like:

Now, all you have to do is write down/email/whatever the network paths (like \\vpn.server.int\Homes\LAUR) and map them from…read more

BAT Files: Execute Multiple Commands in a Loop

Posted by in Software

One of the tasks the other day was to load a large DB organised by year. The most efficient way was to loop through a sequence of years and execute the loader for each one. The first iteration I ended with was:

This means: For years from 1996 to 1998, with an increment of one, execute my load.bat script. Nice, but I wanted to be able to echo some information to the console. Now, there are two ways to do this: Make load.bat print something Add more commands (like…read more

Search exact string in a file on Windows

Posted by in IT

The other day I found a file with a peculiar format and I needed to find it again. There are two problems I’ve encountered: Size: It’s one of 20,000,000 XML files Search: I need to find a file containing a string “xocs:doi”, which is not interpreted as a single word (due to the colon character, of course) My case is search through XML files, but I’ve figured the method is generic enough for any text files. TL;DR: Use the power of findstr, Luke! First Option – Windows Explorer Searching through…read more

Install NumPy in a Virtual Environment on Windows

Posted by in Software

Someone told me they use a custom python install named Anaconda on windows because it contains a set of math packages which are difficult to install. In fairness, they’re right because any python module with native dependencies is a mess to install from sources (e.g. because you need the same version of Visual Studio used to build the python install). When I tried to tell them the benefits of using virtual environments (which are created clean by default), I’ve been asked to try and install numpy in a virtual environment….read more

Install lxml on windows (on a virtualenv)

Posted by in Software

Lxml is a nice python library for XML processing. ETree is really quick, which makes things interesting if you have a large amount of XML files (or a bigger one) to process. Installation on linux/mac is painless (OK, you need homebrew on mac to make int painless, but you get my point…). The other day I had to do it on windows. This is not really painless. I managed to do it, so here are the steps. Prerequisites Python 2.7 VC++ 2880, the Express edition (freely downloadable from Microsoft), because…read more