phpMyAdmin session timeout

By ctherouxNo Comments

phpMyAdmin session timeout is controlled through two parameters. The first one can be found in /etc/php5/apache2/php.ini. It is called session.gc_maxlifetime. The other one can be found in the phpMyAdmin configuration file often named /etc/phpmyadmin/config.inc.php. The name of the parameter is LoginCookieValidity.

The one located in /etc/php5/apache2/php.ini superseeds the one given in /etc/phpmyadmin/config.inc.php if it is smaller.

phpMyAdmin might also have a local php.ini that can override /etc/php5/apache2/php.ini.

phpMyAmdin, Ubuntu, Ubuntu 14.04

Java Applets are no longer working in Linux

By ctherouxNo Comments

NPAPI support was dropped in Chrome version 35 introduced in Spring 2014. One of the consequences is that Java Applets running with IcedTea no longer works.

Upgrading to Ubuntu 14.04 install the newest version of Chrome. You then lose the ability to run IcedTea in Chrome. The only alternative I have found is using Firefox.

Chrome, Java Applets, Linux, Ubuntu 14.04

Issues after upgrading to Ubuntu 14.04.1

By ctherouxNo Comments

After upgrading to Ubuntu 14.04.01, I ran into two issues: One with Apache2 and one with Samba 4.

Apache has been upgraded from 2.2.22 to 2.4.7. The content was no longer accessible. The site configuration directives Order, Allow and Deny such as

Order allow,deny
Allow from all

are now replaced with the Require directive. Detailed information can be found at Apache Module mod_authz_core.

Samba has been upgraded from version 3.6.3 to 4.1.6. The “valid users” behavior changed. It works if the user given in the “force user” directive is listed in the “valid users”. For example, datacloud has to be listed in the “valid users”.

valid users = ctheroux,datacloud
force user = datacloud

Ubuntu, Ubuntu 14.04, Unix

An Arduino library for the MAX7219 Led Display Driver.

By ctherouxNo Comments

The MAX7219 chip does a wonderful job when its time to drive either a 64 led matrix or an eight digit (seven segments) display. Only three wires are required: a chip select (CS), a data in (DIN) and a clock (CLK). The protocol is simple. I’ve written an Arduino library that implements this protocol. Specifications can be found at MAX7219.

The library comes with some code examples. Look in the File >> Examples >> CTTMAX7219 sub-menu in the Arduino IDE. Refer to the display and chip manufacturers to hook the display to the MAX7219 chip. This is straight forward. The display will likely need an external supply. If so, make sure that the Arduino board and the chip have a shared ground. You will need to modify the example code to specify the pins used to connect the DIN, CS and CLK pins of the chip to the Arduino. By default, these are:

/** Clock pin on the arduino. */
int pinCLK = 10;
/** Chip select pin on the arduino. */
int pinCS = 9;
/** Data IN on the arduino. */
int pinDIN = 8;

The download link of the library is CTTMAX7219_v1.0. You can install it through the Arduino IDE using the usual methods. Detailed information can be found at Installing Additional Arduino Libraries.

Arduino

Trinket Support On Linux

By ctherouxNo Comments

The Trinket (Adafruit’s Trinket) can be supported on Linux using the Arduino IDE 1.0.5 in only a few steps.

  1. Download this archive: TrinketHardwareSupport
  2. Install the Arduino IDE. It is assumed below that the main directory is arduino-1.0.5.
  3. Replace the current avrdude.conf in arduino-1.0.5/hardware/tools with the one in the downloaded in the archive. It is recommended that you make a backup of the current avrdude.conf file.
  4. Open a terminal window and run the Arduino IDE as root. You can issue the following command as long as the current directory is the Arduino directory where you installed it (arduino-1.0.5).

    sudo ./arduino

  5. Quit the Arduino IDE
  6. A directory called sketchbook should have been created in /root.
  7. Copy the directory hardware from the downloaded archive in /root/sketchbook.
  8. Within the Arduino IDE, from the Tools/Board menu item, select Adafruit Trinket 8 MHz
  9. Within the Arduino IDE, from the Tools/Programmer menu item, select USBtinyISP

A simple test can be done assuming that the Trinket is plugged on the PC.

  1. From File/Examples/01.Basics, select Blink
  2. Change value of the global variable led to 1.
  3. Upload the sketch to the Trinket
  4. The red led on the Trinket should be blinking.
Arduino, Trinket

How to restore the Arduino Bootloader?

By ctherouxNo Comments

It can be easily done using Linux. This procedure is for the 328p processor. It can easily be adapted for a 168 processor. You will need an ICSP. First, make sure that avrdude is installed. It can be installed by issuing the command:

sudo apt-get install avrdude

You will need to retrieve the bootloader. It can be found in the hardware/arduino/bootloaders/atmega directory in the 1.0.5 Arduino IDE download. It is named ATmegaBOOT_168_atmega328.hex.

  1. Put the chip on an Arduino board.
  2. Connect the ICSP to the Arduino board.
  3. Power the Arduino with an external source.
  4. Connect the ICSP to the computer. Find its serial port. Most of the time, it is listed in the system log. The command ‘dmesg’ can be used to find it out. Look at the last lines.
  5. Open a command line window.
  6. Issue the following commands. Replace /dev/ttyACM0 by the proper ICSP port.
    /usr/bin/avrdude -c avrispv2 -p m328p -P /dev/ttyACM0 -e

    /usr/bin/avrdude -c avrispv2 -p m328p -P /dev/ttyACM0 -U flash:w:ATmegaBOOT_168_atmega328.hex

  7. Unplug the ICSP and reset the Arduino board.
Arduino, Hardware, Linux

Parametrized Measuring Scoop

By ctherouxNo Comments

An “Parametrized Measuring Scoop” is now available. More details at Parametrized Measuring Scoop.

3D Printing, object

PN532 Breakout Board Mounting Plate

By ctherouxNo Comments

An “PN532 Breakout Board Mounting Plate” is now available. More details at PN532 Breakout Board Mounting Plate.

3D Printing, object

How to rename a user in Linux

By ctherouxNo Comments

Simply issue this command:

usermod -m -d /home/new-account-name -l new-account-name old-account-name

It creates the home directory if it does not exists. It also copy the stuff of the old user into the new user account.

Linux, Ubuntu, Ubuntu 11.04, Ubuntu 11.10, Ubuntu 12.04, Ubuntu 14.04, Unix

Enclosure For The Sparkfun RFID USB Reader

By ctherouxNo Comments

An “Enclosure for the Sparkfun RFID USB Reader” is now available. More details at Enclosure for the Sparkfun RFID USB Reader.

3D Printing, object

preinst: line 118: a2query: command not found

By ctherouxNo Comments

If you are getting the following errors while trying to install Apache on Trusty (Ubuntu 14.04), execute the commands below and try to re-install it.


Preparing to unpack .../apache2_2.4.7-1ubuntu4_amd64.deb ...
/var/lib/dpkg/tmp.ci/preinst: line 118: a2query: command not found
dpkg: error processing archive /var/cache/apt/archives/apache2_2.4.7-1ubuntu4_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/apache2_2.4.7-1ubuntu4_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

The commands to resolve this issue are:

dpkg --fsys-tarfile /var/cache/apt/archives/apache2_2.4.7-1ubuntu4_amd64.deb | tar xOf - ./usr/sbin/a2query > /usr/sbin/a2query

chmod 755 /usr/sbin/a2query

Replace /var/cache/apt/archives/apache2_2.4.7-1ubuntu4_amd64.deb with the name of the file given in the error messages. Note that the first command is splitted on two lines in the above. So, copy both lines at once before pasting it in a terminal window.

apache, Ubuntu, Ubuntu 14.04

How To Restore Skype Status Bar Icon In Ubuntu 14.04

By ctherouxNo Comments

After installing Skype on Ubuntu 14.04, there is no icon in the status bar. To restore it, simply execute the following command:

sudo apt-get install sni-qt:i386
.

This procedure works on the 64 bits version of Ubuntu.

Ubuntu, Ubuntu 12.04, Ubuntu 14.04

How to change the maximum upload file size in PHP

By ctheroux1 Comment

You can increase the maximum upload file size for only one application by creating a php.ini file in the directory where the file upload PHP script is. Add the following lines:

; Maximum allowed size for uploaded files.
upload_max_filesize = 40M

; Must be greater than or equal to upload_max_filesize
post_max_size = 40M

It can also be changed system wide by editing the file /etc/php5/apache2/php.ini which is the global php.ini file. Modify the two lines listed above and restart apache.

apache, PHP

20 mm wide 90 Degrees T-Slot Angle Brackets

By ctherouxNo Comments

Some “20 mm wide 90 Degrees T-Slot Angle Brackets” are now available. More details at 20 mm wide 90 Degrees T-Slot Angle Brackets.

3D Printing, object

How to display the version of Ubuntu you are running

By ctherouxNo Comments

From a terminal window, type in:

lsb_release -a

Ubuntu, Ubuntu 11.04, Ubuntu 11.10, Ubuntu 12.04

Parametric Pipe/Rod/Tube Adapter

By ctherouxNo Comments

A “Parametric Pipe/Rod/Tube Adapter” is now available. More details at Parametric Pipe/Rod/Tube Adapter.

3D Printing, object

Tape Roll Holder Revisited

By ctherouxNo Comments

A “Tape Roll Holder Revisited” is now available. More details at Tape Roll Holder Revisited.

3D Printing, object

Mounting plate for Arduino UNO/Duemilanove/Diecimila

By ctherouxNo Comments

A “Mounting plate for Arduino UNO/Duemilanove/Diecimila” is now available. More details at Mounting plate for Arduino UNO/Duemilanove/Diecimila.

3D Printing, Arduino, object

40 MM Angle Bracket With Adjustable Foot

By ctherouxNo Comments

A “40 mm T-Slot Angle Bracket with adjustable foot” is now available. More details at 40 mm Angle Bracket With Adjustable Foot.

3D Printing, object

40 MM T-Slot Adjustable Foot

By ctherouxNo Comments

A “40 mm T-Slot Adjustable Foot” is now available. More details at 40 mm T-Slot Adjustable Foot.

3D Printing, object
Blue Taste Theme created by Jabox