Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

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

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!

Locate command not finding

When the locate command not finding something, it may need to be updated.
sudo updatedb

Preventing Gnome to override Xmodmap Settings

Calling gnome-settings-daemon causes xmodmap keyboard settings to be override. To solve:
1. Dirty way, put sleep after calling gnome, before calling xmodmap
gnome-settings-daemon&
sleep 1; xmodmap ~/.Xmodmap

2. Put into .bashrc, but this causes weird message xmodmap: please release the following keys within 2 seconds
if [ -f ~/.Xmodmap ] ; then
xmodmap ~/.Xmodmap
fi

3. I ended up using this method, but this should also be used with caution, since it seems to remove some custom shortcut settings...
gsettings set org.gnome.settings-daemon.plugins.keyboard active false


Warning: do not use combination of Mod4+p, it's mapped to some display setting by something... Just map the key to Mod3 or others.

Japanese Input on Ubuntu 12.04

Uses ibus
sudo apt-get install ibus-anthy
Add Anthy in Input Method
ibus-setup
in .xsession add
ibus-daemon&

22 February 2013

Sound Blaster Play on Ubuntu

Haven't been able to listen to audio for quite awhile on my Ubuntu.
I finally got myself a Sound Blaster Play.
It didn't worked by just simply plugged.
Calling alsamixer, the sound card used by the system is the default Intel one, not recognizing the Sound Blaster.

So, I tried changing the default sound card, by what's instructed in this post
1. cat /proc/asound/modules
see your default sound card name
2. sudo gedit /etc/modprobe.d/alsa-base.conf
# Prevent abnormal drivers from grabbing index 0
options snd_hda_intel index=1 #change default sound card index to 1

3. reboot

After rebooting, I still couldn't here any sounds.
I couldn't even open alsamixer anymore... =____=;;;
And finally it was solved by opening gnome-volume-control and unmute the sound
I'm using wmii, so I don't have any sound bar, I wonder if the problem was just because it was muted...
But oh well, now I can listen to audio, nevermind what was it...

17 January 2013

R related installing on old ubuntu (9.10 karmic)

wanted to install ggplot2

install.packages("ggplot2")
but couldn't get it through cran anymore

sudo apt-get install r-cran-ggplot2
also couldn't get it through package

so the other way was to download the old tar from cran (start from a relatively new one, the command will give error if your R is too old, karmic is R 2.9.2 btw)
and apparently, this command saves me (I remembered installing manually to R folders, hmm)
R CMD INSTALL Desktop/packagename.tar.gz

PS. sigh, never edit a blogger post anymore, blogger ruined my previous R post

03 January 2013

Linking file from host in Virtual Box


mkdir /home/<user>/vboxshare
sudo mount -t vboxsf -o uid=1000,gid=1000 share /home/<hostuser>/vboxshare
sudo adduser <user> vboxsf
make dir in vboxshare, ln -s that folder in the virtual os

Virtual OS was Ubuntu 12.04, Host was Mac OSX 10.6.8

03 August 2012

viewing usb raw (usb snifing) in ubuntu karmic

1. check kernel version
uname -r
mine is 2.6.31-14-generic
2. since my kernel is > 2.6.21, I need libpcap 1.1.0
locate libpcap
found out mine is libpcap.so.1.0.0
4. ???