26 June, 2016

Linux Mint: Network Manager Headache

The network manager unconnects randomly. It's annoying during streams or online games. I have tried to install wicd, but cannot make the network manager inactive.

Removing the darn thing results in a dark screen. It's almost a Windows blue screen of death experience. And I've had this experience twice.

So now I'm left with a blank screen, gde hangs.

What are my options? Trying:

  • Install KDE
  • apt-get install kde-full
If that does not work the only option is to reinstall the entire system. For the third time.

Perhaps the HP EliteBook favors another Linux flavour?

The trick worked. After installing KDE wicd runs like a charm .. in KDE that is.

20 June, 2016

Gulp

I've experimented with automation, here's the first Gulp file (yea, it's work in progress).
 
/* 

GULP - watch and compile code 
=============================

File: gulpfile.js
Version: 0.1
Tags: Sass watch, Sass compile
By: Per Thykjaer Jensen
Url: http://multimusen.dk/

## Howto

 1. Download plugin
 2. Require the plugin
 3. Define a gulp.task

Run the task either:

 * :: gulp [taskname]
 * or add the task to the gulp.task default and run via :: gulp

Best Practise
=============

Separate your working files into a src/ and a dest/ directory. 
This is my first playground, so the pressent file 
structure is a darn mess.

*/

//'use strict';

// === Gulps ===
var gulp = require('gulp');
var sass = require('gulp-sass');


// sass compiler
gulp.task('sass', function () {
  return gulp.src('./sass/**/*.scss')
    .pipe(sass.sync().on('error', sass.logError))
    .pipe(gulp.dest('.'));
});

// watcher
gulp.task('sass:watch', function () {
  gulp.watch('./sass/**/*.scss', ['sass']);
});

// sass lint
var sassLint = require('gulp-sass-lint');
 
gulp.task('sassLint', function () {
  gulp.src('sass/**/*.s+(a|c)ss')
    .pipe(sassLint())
    .pipe(sassLint.format())
    .pipe(sassLint.failOnError());
});

// minify images
var imagemin = require('gulp-imagemin');
 
gulp.task('imageMin', function () {
 gulp.src('images/*')
  .pipe(imagemin())
  .pipe(gulp.dest('images/mini'));
});


// === Javascript Lint ===
var jslint = require('gulp-jslint');
var jshint = require('gulp-jshint');
 
gulp.task('lintJs', function () {
    return gulp.src(['js/*.js'])
        .pipe(jshint({ /* lint placeholder */ }))
  .pipe(jshint.reporter());

});


// === Jade Template Engine ===
jade = require('gulp-jade');

// run this task by typing in gulp jade in CLI
gulp.task('jade', function() {
    return gulp.src('src/templates/**/*.jade')
        .pipe(jade()) // pip to jade plugin
        .pipe(gulp.dest('builds/development')); 
});


// === Default ===
gulp.task('default', [
  'sass',
  'sass:watch',
  'imageMin',
  'lintJs'], function() {
});

16 June, 2016

Write permission in /var/www/html/

# sudo usermod -a -G www-data[USERNAME]
# sudo chmod -R g+w /var/www
# su [USERNAME]

ad 1) Add the user to the www-data group
ad 2) Give write permissions to the group in /var/www
ad 3) Be that user and edit

28 April, 2016

21 April, 2016

Noscript: a candidate for the most useless plugin for Firefox

Tried the Noscript plugin for Firefox. Yeah: it really blocked all scripts. And nothing worked. Not even a search on Duckduckgo. My browser was probably secured.

But it was also totally useless.

So I decided to dump the darn thing.

16 April, 2016

CakePhp still sucks

Well, I just gave CakePHP one more chance. After a whole day of errors, I guess that enough is enough. Again: the system sucks big time.

Ruby server: the long and winding road

Not elegant, mostly try and error. Eventually everything seems to work, here's the history:

 234  sudo apt-get install build-essential
  235  rails server
  236  rails
  237  ls
  238  cd rails
  239  bin/rails server
  240  ls
  241  cd blog
  242  bin/rails server
  243  gem install bundler
  244  sudo gem install bundler
  245  bin/rails server
  246  bundle install server
  247  bundle install
  248  gem install json
  249  sudo gem install json
  250  rails server
  251  bundle install
  252  sudo apt-get install libgmp-dev
  253  sudo apt-get install libgmp-dev
  254  rails server
  255  bundle install
  256  sudo apt-get install ruby-full build-essential
  257  sudo apt-get install apache2 apache2-mpm-prefork apache2-prefork-dev
  258  sudo apt-get install rubygems
  259  rails -v
  260  sudo apt-get install rails
  261  sudo gem install rails
  262  rails -v
  263  gem update --system
  264  \curl -L https://get.rvm.io | bash -s stable --rails
  265  rails -v
  266  bundle install
  267  rails -v
  268  rails server

03 April, 2016

Lyx and Bibtex: convert .bib file to 8859-1


  1. Install KbibTex.
  2. Open your .bib file.
  3. Save as  ....bib - and remember so set the fileformat to 8859-1.


26 March, 2016

Processing - cross platform

Processing can export to Windows and Linux. For a Mac you need a developer license. Alternative: publish in Python. In the wiki it's said that you need to run OS X in order to export to that OS.

02 March, 2016

WordPress Xampp on Mac - how to install themes or plugins

On a Mac WordPress via Xampp you cannot install themes or plugins because of the settings. In a terminal do like this:

# sudo -i
# (write your password)
# cd /Applications/Xampp/xamppfiles

Now find out where your WordPress files are and cd to the relevant folder, then do something like this:

# chmod -R 777 wordpress/
# chown daemon:daemon wordpress/

Now ... this is a quick and very, very dirty fix. In a production environment the folders should have chmod 755 and the files chmod 644.

24 February, 2016

Linux Evening

Reconstructed my 8 year old server, now it serves as file server. Removed Cinnamon and the slowwww wifi manager. Installed wicd, KDE and lightdm. Added WordPress for tomorrows class.

Linux Antix Missing Icons

Solution: install some icon themes via Synaptic. QED.

15 February, 2016

MySQL World Database

I had some issues with international characters. Solution: install directly from the zip file.

If you try to install the tables at one.com:

  1. Unzip the file.
  2. Edit these lines (from line 18) like this:
-- DROP SCHEMA IF EXISTS world;
-- CREATE SCHEMA world;
-- USE world;
-- SET AUTOCOMMIT=0;

06 February, 2016

Texturepacker - no thanx

Tried the texturepacker for Linux. The result was a total waste of time. Here is the result:


The pictures did were turned up and down, and most of them were covered with an embarassing ad.

Verdict: apt-get remove.

Adobe Flash - or the Image Magick is much better, see my article on Multimusen.dk.

02 February, 2016

Fooling around with Modernizr and Foundation

Modernizr is an easy to use framework consisting of tests like "can my browser _____ "? You'll get a true or false.

Foundation is very much like Bootstrap. However the code seems less bloated. Foundation makes heavy use of Sass. And that's nice.

There are several tutorials e.g. on Youtube, where developers are building Foundation solutions for WordPress.


28 January, 2016

Pandoc - very old version in Linux Mint repo

Tried to follow this guide. Downloaded the Debian packet and installed it from the download page:

 Now pandoc and pandoc-citeproc seems to work.

27 January, 2016

Pandoc error

Looking for at solution for this pandoc error message:

pandoc-citeproc:
Error at "source" (line 1, column 94):
unexpected end of input
expecting new-line
http://student.bus.olemiss.edu/files/conlon/others/others/semantic%20web%20papers/roadmap.pdf


Python and MySQL on Linux Mint

Got an error because the MySQLdb package wasn't found. Solution:

# apt-cache search MySQLdb

python-mysqldb - Pythongrænseflade for MySQL
python-mysqldb-dbg - Pythonbrugerflade til MySQL (fejlsøgningsudvidelse)
bibus - Bibliografisk database
mysql-utilities - collection of scripts for managing MySQL servers
petj-HP-EliteBook-850-G1 ~ # apt-get install python-mysqldb

Then

# sudo apt-get install python-mysqldb

Then everything worked like a charm. 

24 January, 2016

Tomboy Notes

My old laptop literaly crashed. Litterally. During the reconstruction efforts I found out, that one of my primary concerns was to get the Tomboy Notes.

The files are stored in:

~/.local/share/tomboy

Then:

  • #killall tomboy
  • copy the files from the backup
  • paste the files to ~/.local/share/tomboy
  • start tomboy
That's it.

13 January, 2016

How to make an icon for a Python App

The files and the icon.


So now I have some Python GUIs for my Philips HUE, but I'd like to have a nice Desktop Icon, like any other Linux App. How can I do this?

In Ubuntu - and probably most Linux systems the paths to executable programs are stored in hidden .desktop files.

First create a file and save it as .myApp.desktop

The content of the file could look like this:


[Desktop Entry]
Name=Test
Exec=/home/per/Dokumenter/bin/bin/hue/python/tkinterNoter/tkEntry.py
Icon=/home/per/Dokumenter/bin/bin/hue/python/tkinterNoter/multimusen.png
Terminal=false
Type=Application
GenericName="Python tkEntry Exp"

There are more possible setting, see here.

The next step is to make your file executable, write these commands in the terminal window:

# chmod a+x .myApp.desktop
# chmod a+x tkEntry.py
# cp .*desktop ~/.local/share/applications/

In order to give all system user access to your program, you can:

# cp .*desktop /usr/share/applications

Now you'll see an icon with the chosen picture in the folder. You can drag this icon to e.g. the menu. And now you can run your GUI as you would run any program.

The line Terminal can be true or false. If it's true the program will launch in a terminal window.

11 January, 2016

Json Parsing in Python (Philips Hue Sample)

Import libraries:

import requests
import json
from urllib import urlopen

Here's a class that will print out the names of the scenes:

    ''' AUTORUN METHOD '''
    def __init__(self,master):

        self.apiUrl = "http://192.168.0.11/api"
        self.user = "xxxxxxxxxxxxxxxxxxxxxxxxx"

        self.a = urlopen(self.apiUrl 
            + "/" 
            + self.user 
            + "/" 
            + "scenes").read()
        self.a = json.loads(self.a)
 
        for thing in self.a:
            self.theName = self.a.get( thing ).get('name')
            print self.theName

The function will print out a list of scene names.