January 19, 2016 0

keep a checked out version of master updated via hook on a remote server – The JACK hook

By in GIT

A small hook meant to be installed on a remote git repo.

The hook is a post update hook and sould be run by the remote repo each time somebody successfully pushes to the repo.

It will create a directory called master and check out the remote repo into this and make sure to pull changes from the remote repo on every commit.

Essentially you get a disconnected non bare version of the remote bare repo. You should never change the files. If you do the hook will fail. If so just delete the entire master directory that was created. A new directory will be created again on next commit.

Place the following the the hooks directory and call the file post-update

echo "Running post commit JACK hook"

if [ ! -d $(pwd)/master/.git ]; then
echo “creating checkout master copy”
git clone “$(pwd)” $(pwd)/master
fi
echo “updating checked out master”
git –git-dir=”$(pwd)/master/.git” –work-tree=”$(pwd)/master” pull origin

Tags: , ,

May 6, 2015 0

running a bash script from windows command using bash installed by git for windows

By in GIT, Windows

from a windows command navigated to git bin folder one can execute:

bash.exe –login -i

to start a nice shell

if this line is given another parameter its assumed to be a script file which is executed. Additional arguments are passed to the script file as arguments.

bash.exe –login -i “myscript.sh” “arguments”

Tags: ,

March 19, 2015 0

Problems with windows 7. Record interactions with the windows program psr

By in Windows

Problemer med windows? Kender du Windows 7 kommandoen “psr”?

Det er muligvis et værktøj andre end mig vil finde yderst interessant når computeren lige pludselig opfører sig mærkeligt. “psr” er et program der optager skærmbilledet og registrerer tastetryk. Har du et problem med et program der ikke opfører sig som du forventer så start “psr” (tryk windowsikonet nederst i venstre hjørne – skriv psr i indtastningsfeltet nederst i menuen). psr starter op som en lille værktøjslinje med få muligheder, blandt andet mulighed for at starte og stoppe optagelser.

Efter du har startet en optagelse tages der løbende screen shots hver gang du interagere med computeren. Så kan du demonstrere hvor og hvad fejlen består af og derefter stoppe optagelsen igen. Du bliver nu bedt om at gemme en fil. Denne fil vil være en hjemmeside fil der kan åbnes i en browser (prøv at åbne).  I filen er der billeder og en tekst der beskriver hvad du som bruger har foretaget dig under optagelsen. Send så filen til din IT supporter og vent på at personen kommer tilbage med en forkromet løsning på problemet.

Tags: ,

March 13, 2015 0

setting up git mergetool on windows

By in GIT, Windows

One possible merge tool for windows is kdiff3 which works great.

after installing kdiff3 git needs to be set up.

This blog post describes it (http://www.blog.project13.pl/index.php/coding/1192/setup-git-on-windows-to-use-kdiff3-as-its-mergetool/) but its repeated here:

add the following to .gitconfig

[merge]
tool=kdiff3
[mergetool “kdiff3”]
path = C:/Program Files/KDiff3/kdiff3.exe
keepBackup = false
trustExitCode = false

Tags: , ,

November 18, 2014 0

Make QT 5 detectable by cmake on windows

By in C++, cmake, qt, Visual Studio 2013, Windows

It seems that for cmake to be able to find the needed qt .cmake files it’s sufficient to add the qt bin folder to the path env variable (e.g. C:\Qt\5.3\msvc2013_64_opengl\bin)

October 31, 2014 0

Qt creator and perhaps visual studio 2013 is missing include directories and other env variables

By in c++, C++, Visual Studio 2013, Windows

Symptom:

Cant compile any programs and compiler complaining about missing standard header files such as stddef.h

diagnose:

in QT creator go to project settings and inspect environment variables. There should be e.g an INCLUDE variable. If not the vcvarsall.bat file that is accompanying VS is not run propable.

Following this post: http://schrievkrom.wordpress.com/2011/01/25/error-cannot-determine-the-location-of-the-vs-common-tools-folder/

it seems that the windows\system32 folder have been unset in the path. Re-add it to path and see if that helps.

 

Tags: ,

August 3, 2014 0

setting up wifi on raspberry pi

By in linux, raspberry pi

it seems that the /etc/network/interfaces file needs to contain:

wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

and when this is the case you can specify wifi settings in the file /etc/wpa_supplicant/wpa_supplicant.conf

using this example:

network={
        ssid=”TNETRezound”
        psk=”PASSWORD”
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP
        auth_alg=OPEN
        priority=9
}

Tags: , ,

August 2, 2014 0

install brother DCP-J725DW network scanner

By in linux

After downloading and installing the deb file from this link:

http://support.brother.com/g/b/downloadlist.aspx?c=dk&lang=da&prod=dcpj725dw_eu_as&os=128&flang=English

the scanner can be installed either using its ip address or its hostname using the program brsaneconfig4

(The program also have possibilities of listing currently installed devices and test their connectivity using the -q and -p option respectively)

Using hostname:

brsaneconfig4 -a name=BrotherScanner model=DCP-J725DW nodename=dhcppc2

Using ip:

brsaneconfig4 -a name=BrotherScanner model=DCP-J725DW ip=xx.xx.xx.xx

Tags: , , , ,

July 17, 2014 0

convert png image read using PIL to numpy array

By in python

Beware that conversion of an image with a non-standard format using np.array(Image.open(‘imagefile.png’)) can result in strange behavior.

If eg the loaded image have a mode of LA the resulting numpy array are not initiated correctly. Use PIL Image convert function to get a format that you can convert (I expect single and triple channel image to work)

Tags: , , ,

May 12, 2014 0

using sed to process file and delete lines matching a pattern

By in linux
sed '/pattern to match/d' ./infile >> outfile

or

cat file | sed '/pattern to match/d' >> ourfile

Tags: , ,