Tuesday, December 20, 2016

Sunday, November 13, 2016

pygame on ubuntu 16.10 installation

sudo apt install devscripts     # to install dget
dget -u  http://httpredir.debian.org/debian/pool/main/p/pygame/pygame_1.9.1release+dfsg-10.dsc

sudo apt install libsdl-ttf2.0 libportmidi-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libsmpeg-dev


list of dependencies

sudo apt-get install mercurial python3-dev python3-setuptools python3-numpy python3-opengl libav-tools libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsmpeg-dev libsdl1.2-dev libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev libtiff5-dev libx11-6 libx11-dev fluid-soundfont-gm timgm6mb-soundfont xfonts-base xfonts-100dpi xfonts-75dpi xfonts-cyrillic fontconfig fonts-freefont-ttf libfreetype6-dev



Steps to install PyGame using pip
  1. Install build dependencies (on linux):
    sudo apt-get build-dep python-pygame
  2. Install mercurial to use hg (on linux):
    sudo apt-get install mercurial
    On Windows you can use the installer: http://mercurial.selenic.com/wiki/Download
  3. Use pip to install PyGame:
    pip install hg+http://bitbucket.org/pygame/pygame
    If the above gives freetype-config: not found error (on Linux), then try sudo apt-get install libfreetype6-dev and then repeat 3.
Alternative way:
# Grab source
hg clone https://bitbucket.org/pygame/pygame

# Finally build and install
cd pygame
python setup.py build
sudo python setup.py install

Friday, August 12, 2016

How to install Squeak 5.0 on Ubuntu 16.04 x64 64bits

This works in 64 bit Ubuntu 16.04:
In the directory where you unzipped the Squeak-5.0-All-in-One.zip archive, and that contains the squeak.sh file, put the following into a file named libs32.sh :
#!/bin/bash
objdump -p ./Squeak-5.0-All-in-One.app/Contents/LinuxAndWindows/Linux-i686/lib/squeak/5.0-3397/*|
grep NEEDED|
awk '{print $2}'|
sort -u|
xargs dpkg -S|
awk '{print $1}'|
sort -u|
sed 's/:amd64:/:i386:/'|
sort -u|
sed 's/:$//'
Make that file executable:
chmod +x ./libs32.sh
Run it:
./libs32.sh
You will get a list of libraries that need to be installed.
Run
./lib32.sh | xargs sudo apt install
to see what would be installed.
Run
./lib32.sh | xargs sudo apt install -y
to install it.

Monday, August 8, 2016

How to install steam client on Ubuntu 16.04


sudo apt install steam

rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6
rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libgcc_s.so.1

@jvriesem that's not a problem, as you'd have to remove it anyway. The point of this exercise is to make Steam use the system versions of certain core libraries instead of replacing them with versions that don't work. (Why they would ship incompatible versions of standard libraries in the first place is beyond me) – tjollans Jul 24 at 10:25

You can create script with the following content to run it instead of steam:
#!/bin/bash
# Export so all child processes are affected as well
export LD_PRELOAD='/usr/$LIB/libstdc++.so.6'
export DISPLAY=:0
#export LIBGL_DEBUG=verbose
steam
or issue this command from cli

LD_PRELOAD='/usr/$LIB/libstdc++.so.6' DISPLAY=:0 steam

Wednesday, April 27, 2016

How to setup centos as ntp client

# yum install ntp ntpdate ntp-doc
# chkconfig ntpd on

Synchronize the system clock with 0.pool.ntp.org server (use this command only once or as required):
# ntpdate pool.ntp.org



Start the NTP server. The following will continuously adjusts system time from upstream NTP server. No need to run ntpdate:
# /etc/init.d/ntpd start

Configure ntpd (optional)

Edit /etc/ntp.conf, enter:
# vi /etc/ntp.conf
Set public servers from the pool.ntp.org project:
server 0.rhel.pool.ntp.org
server 1.rhel.pool.ntp.org
server 2.rhel.pool.ntp.org


Thailand — th.pool.ntp.org

There are not enough servers in this zone, so we recommend you use the Asia zone (asia.pool.ntp.org):
    server 0.asia.pool.ntp.org
    server 1.asia.pool.ntp.org
    server 2.asia.pool.ntp.org
    server 3.asia.pool.ntp.org

How to enable networking after install centos from minimal cd

$ vim /etc/sysconfig/network-scripts/ifcfg-eth0

ONBOOT=yes


Wednesday, April 20, 2016

How to prepare for installing offline packages in ubuntu linux

A quick hack

A quick hack is to copy all the packages you downloaded for your install to his machine (detailed instructions here). The .deb files are stored in /var/cache/apt/archives, then in the other computer launch Synaptic and select File -> Add Package Downloaded and search the folder were you put the files and open it, accept all (or install from terminal using the command sudo dpkg -i DEB_PACKAGE_NAME).
NOTE:
This assumes that your package manager is not setup to delete the packages straight after install. It also assumes that you are running the same version of Ubuntu (10.10, 12.04, etc) and architecture version (32b or 64b).

A DVD repository
If you want the latest bug fixes and security patches available then have a look at this tutorial, which covers creating your own DVD repository.
share|improve this answer
1  
If you can't run sudo apt-get update this will not work very well, still a good time saver when setting up a new system :) – GM-Script-Writer-62850 Apr 30 '13 at 1:54
    
Agreed, just upgraded two computers to 13.10 from 13.04. The first one had to download ~1.8Gb, copying the content of /var/cache/apt/archives to the second one made it only download ~250Mb. Still, you need a connection to run the install. – Maxime R. Nov 2 '13 at 18:16
    
apt-get update is not needed if you copy /var/lib/apt/lists - this directory contains the repository information that is downloaded by apt-get update. – ignis Mar 19 '14 at 21:21
    
I copied my .deb over to my usb from /var/cache/apt/archives . On the other computer I merely opened the usb drive and double clicked the .deb which launched the Ubuntu GUI Software Updater. Easy pezy. – Jacksonkr 10 hours ago


A USB repository
If you have a decent sized USB stick - assuming around 4-8Gb (or external hard drive) you can set up a custom copy of the Ubuntu repository and configure that as a local repository as covered in AptGet/Offline/Repository on help.ubuntu.com.
To get the actual package files (the .deb files), I suggest using apt-mirror.
The apt-mirror package will help you create a custom mirror which should be smaller than the 30Gb of the full repository. Install the package:
sudo apt-get install apt-mirror
and edit its configuration file
gksudo gedit /etc/apt-mirror/mirror.list
or since Ubuntu 14.04
gksudo gedit /etc/apt/mirror.list
Only include the repository sections you want. Here is a simple example that copies the binary .deb files from all 4 sections (main, restricted, universe and multiverse) as well as the latest bug fixes.
# apt-mirror configuration file
##
## The default configuration options (uncomment and change to override)
##
#
set base_path    /tmp/ubuntumirror
#

## Repositories to copy from - 

## use a mirror so you don't overload the main server!!!

# Lucid binaries - no source files
deb http://archive.ubuntu.com/ubuntu lucid main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu lucid-updates main restricted universe multiverse


## Clean up older .deb files no longer in the archive
clean http://archive.ubuntu.com/ubuntu
It is guesstimated that you will need around 15Gb of space for all 4 sections, without the source.
I have put the path for all the .deb files to be /tmp, make sure you have enough space so your hard drive does not fill up (if your hard drive does fill up and your computer freezes, /tmp should be cleared with a reboot).
If you just want the main files, remove the restricted, universe and multiverse names from the configuration file.
If you are using a different architecture (you have 64bit, but your friend has 32 bit) then add the following at the start of the mirror.list configuration file:
set defaultarch i386
Once you have the apt-mirror configuration you want, run apt-mirror and go do something fun or life changing as it will take hours or days to get the repository (depending on your connection and the Ubuntu mirror you are using).
Once you have the .deb files, copy the files to your USB memory stick (or external hard drive) and set up the local repository as per the article mentioned previously.
Test it works before taking it to your friend!
share|improve this answer
    
The apt-mirror package is detailed at: : apt-mirror.sourceforge.net – jr0cket Aug 5 '10 at 10:39