Skip to content

Instantly share code, notes, and snippets.

@tibovanheule
tibovanheule / .travis.yml
Created October 23, 2018 16:27
gcc-8 and g++-8 on ubuntu 14 for Travis CI
# -Just to install gcc-8 and g++-8 on ubuntu 14-
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt-get install gcc-8 g++-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 60
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 60
# -Travis script-
language: c
#!/bin/bash
# This copies a github enterprise (Ugent Repo to your github)
# Uses an SSH KEY!!!
cd /root/
rm -R project-groep12.git/
git clone git@github.ugent.be:Systeemprogrammeren2018/project-groep12.git --bare -q
cd project-groep12.git/
git remote add tibo git@github.com:tibovanheule/ProjectSysteemProg.git
git push tibo --mirror -q
@tibovanheule
tibovanheule / BlockYouTubeHostsFile
Created January 1, 2019 23:51 — forked from marshyyyy/BlockYouTubeHostsFile
Block YouTube Hosts File
0.0.0.0 host.youtube.com
0.0.0.0 mx.youtube.com
0.0.0.0 admin.youtube.com
0.0.0.0 devel.youtube.com
0.0.0.0 stats.youtube.com
0.0.0.0 http.youtube.com
0.0.0.0 mx0.youtube.com
0.0.0.0 administration.youtube.com
0.0.0.0 development.youtube.com
0.0.0.0 svn.youtube.com
@tibovanheule
tibovanheule / .md
Last active September 5, 2023 07:10 — forked from joepie91/.md
Running a Node.js application using nvm as a systemd service

Trickier than it seems.

1. Set up nvm

Let's assume that you've already created an unprivileged user named myapp. You should never run your Node.js applications as root!

Switch to the myapp user, and do the following:

  1. curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash (however, this will immediately run the nvm installer - you probably want to just download the install.sh manually, and inspect it before running it)
  2. Install the latest stable Node.js version: nvm install stable
**xclip: Pipe output to the clipboard**
To mouse clipboard
> echo 123 | xclip
For the system clip board,( For virtual box )
> echo 123 | xclip -sel clip
man file of xclip [here](https://linux.die.net/man/1/xclip).
@tibovanheule
tibovanheule / README.md
Created May 12, 2019 10:25 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha:

@tibovanheule
tibovanheule / stash.sh
Created May 15, 2019 21:32
Recover lost git stashes
git fsck --unreachable | grep commit | cut -d ' ' -f3 | xargs git log --merges --no-walk
git update-ref refs/stash 4b3fc45c94caadcc87d783064624585c194f4be8 -m "My recover stash"
@tibovanheule
tibovanheule / post-merge
Last active August 30, 2019 15:48 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
changed_files="$( git diff-tree -r --name-only --no-commit-id origin/master HEAD)"
changed() {
echo "$changed_files" | wc -l | grep --quiet "[123456789]*" && eval "$1"
}
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
}
for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done
mkdir ./output
mogrify -path ./output -depth 8 -resize 16% -compress LZW -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace RGB *