Tag Archives: windows

10 steps to install LyX on Windows

Here the steps to install LyX on Windows:

  1. Download MiKTeX to provide LaTeX (usually the 64bit version)
  2. Select the installation directory and remember the path
    mikitex
  3. Complete the installation procedure
  4. Download and install LyXWinInstaller
  5. Press Next until a dictionary list is presented: add dictionaries for your languages
  6. Before installing the MiKTeX will be shown:
    lyxwin
  7. Click Install and proceed.
  8. You should get an Update popup for MiKTeX, check the connection settings and then proceed and click Next to update all packages
  9. After the update close the MiKTeX popup and wait to LyX installation to finish: it should take minutes, to see progress click “See details” so you can see it’s not hanged up but it’s simply fetching different templates you can use later.
  10. Select Launch LyX and start using LyX

Now you can enjoy LyX for Windows to create PDF using LaTeX without having to deal with the usual formatting hassles of a WYSIWYG editor.

If you’re a beginner or you want to jog your memory about LyX select Help > Tutorial.

To export to PDF you can user File > Export and then select PDF LuaTeX or PDF XeTeX. In my case LuaTeX generate larger document than XeTeX but both are nicer than those generated by ps2pdf.

Advertisements

Python: MySQLdb on Windows virtualenv (w. figures)

If you have a virtualenv on Windows and you want to add MySQLdb support via mysql-python, read this before spending hours of your life to figure why it doesn’t and it will never work.

1) Install MySQL for Python selecting the same Python version of the virtualenv

python-mysql-win

2) From site-packages directory above, copy the selected files:

python-mysql-mysqldb

3) (optional) On PyCharm, look for virtualenv site-packages inside the path marked with the arrow:

pycharm-virtualenv

4) Open your virtualenv console ad do:

import MySQLdb

MySQL for Python is now installed on your virtualenv.

About the same topic
How to Install MySQLdb in PyCharm, Windows
Linux: MySQLdb on virtualenv with –no-site-packages

 

How to fix freezed Windows 7

If your Windows system is slow and you’ve already tried to clean up the autostarts you may have other issues. To do a global check on your system you can follow these steps:

  1. Download Hiren’s Boot CD (list of software installed here)
  2. Extract the zip file in a new folder (the zip contains many files)
  3. Use the shipped CD creation tools BurnCDDC or use the excellent cdrtools Frontend going to CD image > Write image and choosing the Hiren’s.BootCD.x.x.iso file inside
  4. Restart the PC with the CD in and boot from disk: after the boot a screen will be presented, usually you have to press a key like F12 to choose a boot device or press a key like F2 to go to BIOS and choose the boot order putting the DVD first
  5. Choose Start Mini Windows XP and press Enter
  6. After boot, you’ll see an interface similar to Windows XP: on Desktop click on My Computer to view if all drives are listed. Take a look at the space left on devices
  7. Start > Programs > Check disk, insert the letter of the drive to check and then Enter
  8. (Optional) After the disk check, you can also use other disk tools from Desktop > HBCD Menu > Programs > Hard disk tools if needed. Be careful, some tools can be dangerous and you have to know what you’re doing
  9. Now that disk error are fixed, go to Desktop > HBCD Menu > Programs > Antivirus/Spyware and choose Avira or Malawarebytes’ Anti-Malaware
  10. Choose the units and the scan mode and then run the tool
  11. Repeat these steps with all tools you need in the Antivirus / Spyware section
  12. Go to Desktop > HBCD Menu > Programs > Cleaners > CCleaner or ATF Cleaner and clean temporary files and entries from your system. Warning: personal data like browser saved password could be lost, choose the cleaning options carefully
  13. On Desktop > HBCD Menu > Programs > Cleaners > MyUninstaller uninstall all application you don’t need
  14. Check the space left on the disks on Desktop > My Computer. If little space is left on the main drive use Desktop > HBCD Menu > Programs > Cleaners > Windirstat to find big files (about Windirstat)
  15. Now it’s time to look at the apps in autostart: go to Desktop > HBCD Menu > Programs > Startup tools > Autoruns: this is a Microsoft app that lists all application executed automatically. Look for suspicious entries and disable what you don’t need
  16. You can explore other tools on this bootable CD depending on your needs

Tested with Hiren’s BootCD 15.2

Screencapture to GIF: how to record desktop and save screencast as animated GIF

This is a step-by-step howto to record your desktop and then save it as animated GIF using free software. The resulting file will be very small compared to video files, e.g. a 2 minutes long screencapture of a webpage browsing can be less than 1MB.

Requirements:

  • Windows
  • CamStudio
  • VirtualDub
  • Gimp
  • Gigabytes of free space in the destination drive for the intermediate video screencapture

How to:

  1. Install CamStudio
  2. Install VirtualDub (if you have a 64bit OS install the 64 bit version)
  3. Prepare the window you have to screencapture
  4. Capture the video
    1. Open CamStudio
    2. Options > Video Options > Codec Intel IYUV (lossless) and then OK
    3. Select Region > Windows (or other as needed)
    4. Press the record button and select the Window to record
    5. Press stop to stop recording
    6. Select a destination directory and filename: make sure you’ve enough free space
  5. Convert to GIF
    1. Decompress VirtualDub and launch the Veedub64.exe (user interface) or equivalent
    2. File > Open video file and then select the previously generated file (step 4.6)
    3. Video > Frame rate > Frame rate conversion
    4. Select Convert to fps and specify a low value like 2 and then OK
    5. Video > Color Depth
    6. From Output format to compressor / display select 16 bit RGB (555) or greyscale (0-255): it will downsize the output GIF file
    7. File > Export > Animated GIF
    8. Select Play once, infinite loop or specify a loop number
    9. Save the resulting file
  6. Edit the GIF
    1. Launch GIMP
    2. Optional: Select Window > Single window mode to keep all tools in one window (useful for PhotoShop users)
    3. Open the generated GIF (step 5.9)
    4. Crop, rescale and alter the image as you like
    5. Optional: Image > Mode > Indexed to change colors reducing filesize
    6. File > Export as… > Animated GIF
    7. Check the “As animation” flag
    8. Export

The GIF can now be published on forums, WordPress.com or any image hosting provider.

Free disk space by finding big files

Here you can find some useful application to look for big files on disk for Windows and Linux. These disk tools are all free software, and very useful to find big files on disk and free disk space.

On Windows: WinDirStat

  • Download and install WinDirStat
  • Run WinDirStat on your disks (it will take time)
  • You’ll see a coloured map of file occupation by file type

windirstat

On Linux command line: ncdu

  • On Ubuntu / Debian
    • apt-get install ncdu
    • cd /dir/to/check
    • ncdu
  • On CentOS / Fedora / RedHat
    • yum install ncdu
    • cd /dir/to/check
    • ncdu
ncdu-screenshot

ncdu screenshot by dev.yorhel.nl: Official Website

On Linux with window manager

  • CentOS / Fedora / RedHat
    • apt-get install k4dirstat
  • On Ubuntu / Debian
    • yum install k4dirstat

Again, you’ll see a coloured map of file occupation by file type.

Official website

 

dirstat1-yuenhoe

Screenshot by yuenhoe.com

How to start programming in Python on Windows

To develop in Django can be confusing for a new Python developer but using Windows to develop in Django can be a major obstacle too.

How to choose the right IDE for Windows and how to find and install Python libraries? Below six fundamental resources to program with Python on Windows.

Bitnami Django Stack

For developer using Windows, Bitnami Django Stack is a life-saver. It raises you to the need of installing and configuring many libraries and simply create a Python / Django environment on your system. Even if you don’t want to use Django, it can be a great starting point to install Python and fundamental libraries you can extend via PyCharm.

PyCharm

complexlook2x

Screenshot: official website

JetBrains’ PyCharm is the multiplatform IDE to develop in Python. You can forget about the indentation issue and focus on programming. The autocomplete dropdown, the Python console, the easy management of DVCS systems (Git, Mercurial), the easy access to Python packages repositories will make it the tools for Python programming, especially in Windows where there are few alternatives than Linux. On Windows, rely on the Bitnami Django Stack you’re using to load the right libraries.

PyPI – Cheese Shop

PyPI is the repository of Python packages. Since the PyPI is nearly unpronounceable, you can call it Cheese Shop. Python was named by Guido van Rossum after the British comedy group Monty Python and the Cheese Shop is this sketch:

Contrary on the poor guy in the sketch, you will find all sort of cheese you need in the cheese shop.

Pip

Pip is the definitive tool for installing Python packages from Cheese shop on your environment. pip install package-name and you’ll get the package ready and running. Even more interesting is the pip install -r requirements.txt feature. It will install all the packages listed in the requirements.txt text file usually shipped with a package having some dependencies.

PgAdmin

pgadmin4-properties.png

Screenshot: official website

Django and PostgreSQL DBMS are a powerful couple. If you have to use a PostgreSQL database, the best interface you can use is PgAdmin.

Django Packages

Django Packages is the Hitchhiker guide to the cheese shop. You’ve to choose a REST framework but you don’t want to marry with a unreliable partner? You need a good photo gallery and you want to get the best django app to implement in your django application? Django packages will guide you to the best solution for your needs.

django-packages

Any feature has a comparison matrix, where all projects are listed in columns where these criterion, elaborated from Github, are contemplated:

  • Project status (production, beta, alpha)
  • Commit frequency in the repository
  • How many times the project was forked
  • Who work on the project
  • Link to online documentation
  • Features comparison

If you’re coming from a CMS like Drupal here some tips to how to approach a Model-View-Controller like Django, starting from the Entity-Relationship model.

Personal note: Back in the 1998 I start to develop application for the web using ASP and PHP and dependencies weren’t an issue since these languages are for the web. Developing in Python is more challenging and really more fun than programming in PHP. You have a powerful multipurpose language with a ton of libraries competing in a far larger arena than the web development. Not surprising, Google use this language extensively as of some popular web services like Pinterest and Instagram: these last two are using Django.

Read also on the same topic: Django development on Virtualbox: step by step setup

Windows 7: disable sound on screen lock

I have to confess one of my sins. I use Windows 7. Stop. I know, I talk about open source a lot, I’m a proud linux user but yes, I have to use this OS, especially on work. What do you do for money, eh?

I usually play some music while doing some coding. If you ever tried to use PHP as a real programming language, maybe if you’re here you know what I’m speaking of. You can’t without music, seriously.

So you go to eat or to microwave something to eat during your PHP yoga practice. You lock the screen with WIN + L shortcut but the music keep playing in background, in the barely audible hearphones on your desk. I don’t like it, and manually disabling it every time is a waste of time.

Well, I’ve just discovered this small utility for Windows named Mute on Lock. Just keep it on tray icon and this small application will mute audio on lock.

If you run Windows 7, you have to search the application from the search box on start, 1) right click on 2) Properties 3) Compatibility 4) Windows XP (service pack 3 is fine).

Close and restart program and try to lock screen with WIN + L or by the start button.

Remember that when you unlock the screen, music will start to play again, so pay attention.

See also: