ict.ken.be

Delivering solid user friendly software solutions since the dawn of time.

Export Mercurial into Git  

Categories: Git Mercurial

How sad that I have to write this post... proves once more that it's all about the marketing and communication, not so much the product.

Anyway, here how you can import your hg history into git using TortoiseHg

  • TortoiseHg > Global Settings > Extensions > Enable hggit
  • create a new git repo : git init --bare .git OR  git clone --bare https://git.ken.be/my-new-repo
  • cd to your hg repository and you might create a bookmark : hg bookmarks hg
  • hg push c:/path/to/your/new/git/repo
  • cd to your git repo
  • if you used init before: git config --bool core.bare false (when you used bare command before)
  • if you used a bookmark merge hg branch into master
  • push changes to remote repository
  • delete local version and get a normal clone.

And you have a new git repo with all your hg history in it. Awesome.

Or not so awesome: https://www.youtube.com/watch?v=CDeG4S-mJts 

Jekyll serve does not render layout 

Categories: Visual Studio

So you are using visual studio to do some jekyll github pages.

Did you save the files as UTF-8 without signature ?

  • File > Advanced Save Options...
  • Tools > Options > Text Editor > General > Auto-detect UTF-8 encoding without signature
  • Tools > Customize > Commands tab > Menu bar > File > Add Command... (if advanced save missing)

Add webcam stream to ipfire 

Categories: Network

Things to remember

  • Ipfire default web interface is on http port 81 or https port 444
  • Add .1 to version in /opt/pakfire/etc/pakfire.conf and do pakfire update --force so you can install addons from testing branch
  • Use pakfire to install motion
  • Motion by default streams on port 2500, but you can set this in /etc/motion.conf
  • Needed to add a video user and video group
  • The boot file /etc/init.d/motion needs some adjustments to allow starting motion at boot time
  • Set firewall rule correct to forward the port: From any to firewall red for tcp on port 2500 for webcam

Posts that helped me on the way

Adjustments to motion configuration

/etc/motion.conf

mkdir -p /var/motion/cam1
chown -R video: /var/motion/cam1
mkdir -p /var/run/motion/
chown video:video /var/run/motion/
chmod 755 /var/run/motion/
loadproc sudo -u video /usr/bin/motion

Move snapshots to dropbox

/etc/motion.conf

on_picture_save /etc/init.d/dropbox/up-snapshot.sh %f %Y%m%d %H%M%S

up-snapshot.sh

/etc/init.d/dropbox/du.sh upload $1 cam1/$2/$2-$3-snapshot.jpg && rm -f $1

Sync dropbox to main website on ipfire

sync.sh

rm -rf /srv/web/localhost/html/
/etc/init.d/dropbox/du.sh download html/ /src/web/localhost/
find /srv/web/localhost/html -type f -exec chmod 644 {} \;
find /srv/web/localhost/html -type d -exec chmod 755 {} \;

up-missing.sh

find /var/motion/cam1 -type f -exec sh -c './du.sh upload {} cam1/{}' \;

Linux commandline 

Categories: Linux

Bash

  • clear : empty console
  • ls -soah : show file details
  • cat filename : show content inline
  • less filename : show content in scrollable way
  • rm -I glob : remove but confirm once
  • mkdir -p : create new folder, ignore if exits
  • top : show processes
  • htop : show processes with colors
  • pstree -p : show which process contains what other process by id
  • kill processid : terminate process
  • df -h : show diskspace
  • reboot : restart the system
  • lsof -i : list open ipv[46] files by process
  • netstat -tulpn : display listening sockets
  • nmap -v 192.168.1.1 : find open ports on gateway
  • nc : networking tool - see https://en.wikipedia.org/wiki/Netcat
  • dmesg | grep -iC 3 "search item" : find in debug messages
  • curl -L ken.be : show website content inline and follow redirects
  • who : currently logged in users
  • whoami : user that run this command
  • passwd -Sa : show status of all accounts
  • groupadd groupname : create new group
  • useradd -m -g groupname username : create home, add user and assign group 
  • find / -group groupname : find files owned by group
  • find / -user username : find files owned by user
  • stat -c %U /var/motion/cam1 : show who ownes the folder
  • sudo -u username somecommand : elevate permissions for command
  • chown video:video /var/whatever : change file ownership
  • chmod 755 /var/whatever : change file permissions
  • chmod +x script.sh : add execute permissions to script file

Disable Angular Debugging 

Categories: Angularjs
myApp.config(['$compileProvider', function ($compileProvider) {
            $compileProvider.debugInfoEnabled(false);
}]);

It keeps amazing me why people do not disable debugging when deploying to production.

Page 6 of 43 << < 1 2 3 4 5 6 7 8 9 10 20 40 > >>