Optimize your website with a few linux command line tools

When optimizing your website you will notice that images, and static resources are the most delaying the load of your website. You can use numerous tool to optimize them on the fly and cache them in WordPress or Joomla cache. I personally prefer to optimize them for once and save them on the disk.

The latter is requiring some access to the Linux command line and is therefore reserved for the most tech oriented people. I am presenting here some tools: Guetzli and PNGQuant, uglifyJS but there are more available. At this point of time these tools are the best in their category.

Optimizing JPEG files

Guetzli is a Google JPEG encoder that aims for excellent compression density at high visual quality. Guetzli-generated images are typically 20-30% smaller than images of equivalent quality generated by libjpeg. Guetzli generates only sequential (non progressive) JPEG due to faster decompression speeds they offer.

Install it

apt install guetzli # linux
brew install guetzli # macos
# windows user should use binary releases https://github.com/google/guetzli/releases

It is recommended to always do a backup of the folder containing your images, just in case. (real men don’t do backup but they often cries). I run Guetzli recursively in all sub-folder using find

find . -type f -name "*.jpg" -exec guetzli {} {} \;

Optimizing PNG files

pngquant is a command-line utility and a library for lossy compression of PNG images. The conversion reduces file sizes significantly (often as much as 70%) and preserves full alpha transparency. Generated images are compatible with all web browsers and operating systems.

apt install pngquant # linux
wget https://pngquant.org/pngquant.tar.bz2 # macos
# windows user should use binary releases https://pngquant.org/pngquant-windows.zip

I use the same technique, running pngquant recursively in all sub-folder using find

find . -iname "*.png" -exec pngquant -f -ext .png --verbose {} {} \;

Optimizing JavaScript files

Warning: i do not recommend to optimize official files of WordPress or Joomla. Some build int scanner that checksum internal file may detect this changes as a security breach: new code checksum do not match official WordPress expect checksum anymore.
It can be use for plugins and your own custom JavaScript code through.

UglifyJS is a general-purpose JavaScript parser/compressor/beautifier toolkit. 

find . -maxdepth 1 -iname "*.js" -exec uglifyjs --compress --mangle -o {} -- {} \;

Neo Geo UNIBios 4.0 is now free for personal use

The UNIVERSE BIOS is for owners of SNK MVS or AES hardware that want an easy way to change country region or between Arcade or Console mode on boot. Also included are other features that are not possible using the standard MVS bios.
 
The UNIVERSE BIOS is also designed to give easy access to things like inserting coins, test mode and memory card management when using the joystick ports only. Of course the BIOS still allows standard operation too.

The free UNIVERSE BIOS versions below can be used for personal use only, before downloading you must accept and agree to the following terms;

  • That you own an original NeoGeo MVS, NeoGeo AES or CD system.
  • The UNIVERSE BIOS will be for your sole personal use only.
  • Not to distribute the UNIVERSE BIOS in any way (physical or digital).
  • Not to included the UNIVERSE BIOS in any product that is sold.
  • Not to sell the UNIVERSE BIOS on EPROM (or any other physical medium).
  • Not to alter the UNIVERSE BIOS image file in any way.
  • Not to hold me responsible for any damage caused by using the UNIVERSE BIOS.

Download it HERE

The following codes should be used on the 1up controller while the splash screen is showing or held during power up if the splash screen is disabled;

     (A)+(B)+(C)		UNIVERSE BIOS Menu

     (A)+(B)+(C)+(D)	Memory Card Manager

     (B)+(C)+(D)		Test Mode (MVS only)

     (B)+(C)+(D)		Hardware Test (AES only)

     (Use 2up controller for the following code)
     (A)+(B)+(C)+(D)	Controller Test (AES only)

The following codes are available in game only, they will not work if you have disabled the in game menu (general bios settings);

    (START)+(SELECT)	In Game Menu

    (START)+(COIN)		In Game Menu

    (START)+(A)+(B)+(C)	In Game Menu

XMR-Stak-Nvidia miner running in docker

XMR-Stak is a universal Stratum pool miner. This is the NVIDIA GPU mining version; there is also an AMD GPU version, and a CPU version.

Docker® containers are often used to seamlessly deploy CPU-based applications on multiple machines. But Docker Engine does not natively support NVIDIA GPUs with containers.

I have dockerized the Nvidia GPU-mining version, so it is now running in nvidia-docker.

Containerizing GPU applications provides several benefits, among them:

  • Reproducible builds
  • Ease of deployment
  • Isolation of individual devices
  • Run across heterogeneous driver/toolkit environments
  • Requires only the NVIDIA driver to be installed
  • Enables “fire and forget” GPU applications
  • Facilitate collaboration

Check my  code at https://github.com/cedricwalter/docker-xmr-stak-nvidia

or pull the image from docker hub https://hub.docker.com/r/cedricwalter/xmr-stak-nvidia/ 

Running an Ethereum Node with Docker

Docker is a powerful tool for managing containers and run-time environments and, besides its many advantages, Docker can also be handy to keep your server tidy and secure.

#Docker allows to run operating systems, applications and tools in so called Containers. A #Container is an isolated environments that represents a autonomous host on its own – a bit in the same way a Virtual Machine does. Yet, Docker Containers are much lighter. They do not start an entire full-blown operating system for each Container instance. Instead, Docker uses #Linux kernel isolation mechanisms to run applications on the top of the host’s operating systems, yet keeping them isolated.

The Ethereum Go (language) team builds a Docker image of a “geth” node as part of their continuous build chain. Their Howto is more then enough to run your full node, mine below is just an enhanced example with volume, name, .. nothing fancy.

# i want to persist the blockchain in a volume

docker volume create --name=ethereum-data

# and limit cpu usage to 20% of all 8 cores –cpus=”.2″, give a name to container, more command line options

docker run --cpus=".2" -d -p 8545:8545 -p 30303:30303 \
 --name=ethereum-node \
 -v ethereum-data:/root/.ethereum ethereum/client-go \
 --rpc --rpcaddr "127.0.0.1"

to stop and recreate the container

docker stop ethereum-node && docker rm ethereum-node

to go inside the container

docker exec -it ethereum-node bash

to test the RPC api

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' localhost:8545

or 

curl -H "Content-Type: application/json" -X POST \
 --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest", true],"id":1}' http://127.0.0.1:8545

see https://ethereum.gitbooks.io/frontier-guide/content/rpc.html 

You may want to register your node at The Ethereum (centralised) network status monitor , in that case just follow https://github.com/ethereum/wiki/wiki/Network-Status 

My Ethereum node is now running at http://ethereum.galaxiis.com

A better status page is in development using PHP with RPC

cedThumbnails 2.6.0 for J2.5 Released

CedThumbnails has been updated to version 2.6.0 and contains 4 new features and correct 1 bug for #Joomla 2.5. For existing users the update will display in the Extensions Manager under Updates. If you do not have this currently installed, you can click the link below and install like you are use to via the Extensions Manager.

Continue reading cedThumbnails 2.6.0 for J2.5 Released

Apple iPhone Screen Repair: iPhone 3GS

apple-iphone.3gs.repair.diy

I will show you how to repair a cracked or broken iPhone 3G, iPhone 3GS, iPhone 4, or iPod Touch screen yourself.

In brief, what you need to know

  • The 3G and 3Gs screens are different! you can not mount an iPhone 4 screen on a 3G(s)
  • There is NO 3rd party or lower quality screens, all 3rd party repair company just LIE.
  • Different kit are available:
  • LCD only for 12€ to repair a broken LCD screen only: the iPhone has an intact glass screen, however the image behind the glass screen is absent, broken or distorted.
  • Glass + digitizer for 22€ This is for an iPhone 3G device with a broken glass screen or malfunctioning touch screen with the image (LCD Screen) behind the screen still intact.
  • Glass + digitizer + LCD + button + speaker mounted for 42€ the most expensive but the easiest to replace
  • Duration: 30, 15 or 2 minutes depending on the kit
  • I went for the most expensive Kit on ebay.fr, which allow you to replace the broken screen by removing 2 screws, an connecting 3 cables!

    By the way I would NEVER send any phone to anyone, how do you think all these private pictures land on forums? removing the sim card is not enough, there are tools to fetch data even after the have been removed!

    Continue reading Apple iPhone Screen Repair: iPhone 3GS

    When using Maven jetty:run, CSS and JavaScript files are never updated

    I was getting mad because jetty was refusing to redeploy my static files (xhtml, css) in #Eclipse until I find the reason

    The Jetty Web Server provides a HTTP server and Servlet container capable of serving static and dynamic contend either from a standalone or embedded instantiations.

    Jetty buffers static content for webapps such as html files, css files, images etc and uses memory mapped files to do this if the NIO connectors are being used. The problem is that on Windows, memory mapping a file causes the file to be locked, so that the file cannot be updated or replaced. This means that effectively you have to stop Jetty in order to update a file.

    To fix this, add a line with to your #maven-jetty-plugin configuration:

    org.mortbay.jetty  maven-jetty-plugin  6.1.5       ...    src/main/resources/webdefault.xml     

    The default webdefault.xml file is found in the lib/jetty.jar at org/mortbay/jetty/webapp/webdefault.xml. Extract it to a convenient disk location and edit it to change useFileMappedBuffer to false:

          useFileMappedBuffer       false     

    Copy the changed file into src/main/resources/ of your project.

    The problem is explained more in Jetty’s documentation.

    Picasa 3.5 available with face recognition / easy geotagging

    picasa.logo  Picasa is starting to be really the best free picture viewer (beside XnView for converting pictures)

    This version bring 2 new highly desirable features

    Add name tags – Picasa 3.5 scans all the photos in your collection, identifies the ones with faces, and groups photos with similar faces together. It’s easy to add name tags to dozens of photos at once by clicking “Add a name” below a photo and typing the person’s name. Once you’ve tagged some pictures, you can make a face collage with one click, easily find all your pictures with the same two people in them, or upload your name tags to Picasa Web Albums

    Continue reading Picasa 3.5 available with face recognition / easy geotagging

    3840 x 1200 and 4TB

    Some insane figures…

    48inch 3840 x 1200 pixels wide desktop

    24inch.office.innoveo

    This is since yesterday my new working place at www.innoveo.com I’ve get rid of my old dell 21” for two new 24” Samsung SyncMaster 245B in 1920*1200 pixels. The 2 monitors are connected through a docking station (VGA D-SUB and DVI), the image is a lot clearer on the DVI cable.

    Connections are somehow limited to DVI and VGA, but the price value of these monitor babies is more than interesting: 360 euro each!

    The graphic card is a NVIDIA GEFORCE QUADRO FX 1500 (512MB RAM) and thanks to the Nvidia control panel very easy to setup

    dual.display.samsung245b

    Characteristics: 1,920 x 1,200 5ms 400cd/m2 brightness 1,000:1 contrast ratio DVI HDCP, VGA 3yr warranty 555 x 250 x 455-555mm 8.4kg

    4 TB

    is the amount of disk at my disposal at… home

    • 1.5TB in raid5 (6 disks of 300GB each), SATA2
    • 1TB in just a bundle of disk (JBOD), SATA2
    • 300GB + 250GB  external disks on FireWire
    • 300GB external disk on USB2
    • 250GB in my notebook
    • 200GB in my PS3
    • 200GB in my NAS System Disk (OpenSuse 10.3)

    a virtual product also need a box

    I am trying to design some boxes for all my project, this has force me to play a little bit with:

    • Inkscape (GNU vector graphics)
    • Gimp (GNU 2D graphics images)
    • 3dBox maker (great tool for $29)

    result of 20minutes of try and errors, feedback welcomed. It is not definitive in any ways. Products will always stay free and under GPL: it is only for FUN