06 October 2014

ubuntu 14.4, opengl, touch, gtkmm

http://vbkaisetsu.sky-air.net/wordpress/2012/03/gtk-3-4-%E3%81%AE%E3%82%BF%E3%83%83%E3%83%81%E3%82%A4%E3%83%99%E3%83%B3%E3%83%88%E3%82%92%E8%A9%A6%E3%81%99/
g++ `pkg-config --cflags gtk+-3.0` a.cpp -o hello `pkg-config --libs gtk+-3.0` -fpermissive

https://gist.github.com/chergert/4344205
python touchy.py

chromium-browser --touch-events=enabled

http://blog.vucica.net/2014/03/ubuntu-touchscreen-and-multiscreen-hd-touchscreen-on-the-left-laptop-on-the-right.html

install GL
sudo apt-get install freeglut3 freeglut3-dev

install gtkgl
sudo apt-get install gtkgl-dev
example for gtkgl
http://gtkglarea.sourcearchive.com/documentation/1.2.3-2.2/simple_8c-source.html
compile
g++ `pkg-config --cflags gtkgl-2.0` simple.cpp -o hello `pkg-config --libs gtkgl-2.0` -fpermissive -Wformat-security

g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2


gl with gtk3

https://github.com/tdz/gtkglext

http://stackoverflow.com/questions/12076648/is-there-a-way-to-have-an-opengl-context-inside-a-gtk3-application

https://www.youtube.com/watch?v=CvBbphubIGo
https://github.com/andrepiske/tegtkgl
gcc -Wall -g `pkg-config --cflags gtk+-3.0` main.c tegtkgl.c -o hello2 `pkg-config --libs gtk+-3.0` -lX11 -lGL -lm

12 September 2013

VIA embedded EPIA boards

Anyone using these boards? Maybe not. Couldn't find much info on the connectors. But it has serial ports which is good for our needs. I forgive the hard-to-understand-connectors. =o=

Apparently, the connector for the UART Neltron 1600 series is the same as JST SH series. One of them being SHR-10V-S-B. The pin headers are QI 2mm (probably usable).

source: http://www.viaarena.com/forums/archive/index.php?t-41593.html

02 March 2013

Icon in login screen of Ubuntu 12.04

Having many custom xsessions with blank icons are confusing...
To change the white circular icon:
source
gimp /usr/share/unity-greeter/unknown_badge.png
save as
/usr/share/unity-greeter/custom_SESSIONNAME_badge.png

Install chrome 12.04

downloading .deb from google didn't work (maybe I forgot sudo)

source
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get install google-chrome-stable

01 March 2013

Webserver on Ubuntu 12.04

I wanted to have my own wiki on my Ubuntu.

1. install apache
sudo apt-get install apache2

2. install php
sudo apt-get install php5 libapache2-mod-php5

3. restart
sudo /etc/init.d/apache2 restart

4. test with /var/www/info.php at localhost/info.php
<?php
phpinfo();
?>


5. using home folder instead of /var/www
sudo mv /var/www /var/www-backup
sudo ln -s /home/username/Sites /var/www


And then I can have my sites also backed up on Dropbox! Yay!

Moving Pukiwiki on PHP 5.4.6

source

The frontpage was blank, I thought I was doing something wrong with my website settings.
But turns out pukiwiki wasn't working well on php 5.4 without changes.
It can be seen on the blog above, I'll rewrite it again here:

1. lib/func.php
Comment out bin2hex() function
// Inversion of bin2hex()
/* 
function hex2bin($hex_string)
{
// preg_match : Avoid warning : pack(): Type H: illegal hex digit ...
// (string) : Always treat as string (not int etc). See BugTrack2/31
return preg_match('/^[0-9a-f]+$/i', $hex_string) ?
pack('H*', (string)$hex_string) : $hex_string;
}
*/


2. plugin/ls2.inc.php
array_walk($args, 'plugin_ls2_check_arg', & $params);
to
array_walk($args, 'plugin_ls2_check_arg', $params);

It already worked at this stage, but just in case, I also did this

3. lib/convert_html.php, lib/link.php, lib/init.php
change all & new to new

When moving pukiwiki to a new server, need to do:
chmod 666 *
chown username:username *

for wiki/ backup/ diff/

Tar newly changed files

find /home/user/Dropbox/ -name '*pdf' -mtime -2 | xargs tar -rf ttt.tar; gzip ttt.tar

file changed 2 days ago