Skip to content

Instantly share code, notes, and snippets.

View cedced19's full-sized avatar

Cédric JUNG cedced19

View GitHub Profile
@cedced19
cedced19 / learn-memory.service
Last active October 15, 2016 08:45
Services for systemd to put at /etc/systemd/system/
[Unit]
Description=Learn Memory
After=syslog.target network.target mongodb.service
[Service]
ExecStart=/root/.nvm/versions/node/v6.0.0/bin/node /node/learn-memory/bin/learn-memory
Restart=always
RestartSec=10
StandardOutput=syslog
StandardError=syslog
@cedced19
cedced19 / Caddyfile
Last active June 27, 2016 09:21
My caddy configuration https://caddyserver.com.
mydomain.com:443 {
tls [email protected]
proxy / localhost:7772 {
except /views /fonts /javascripts /langs
}
root /node/learn-memory/public
gzip
}
mydomain.com:8082 {
tls [email protected]
@cedced19
cedced19 / .bashrc
Last active September 7, 2016 15:07
My .bashrc: it uses http://bashrcgenerator.com/.
export PS1="[\[$(tput sgr0)\]\[\033[38;5;208m\]\A\[$(tput sgr0)\]\[\033[38;5;15m\]] \[$(tput sgr0)\]\[\033[38;5;82m\]\u\[$(tput sgr0)\]\[\033[38;5;83m\]@\[$(tput sgr0)\]\[\033[38;5;82m\]\H\[$(tput sgr0)\]\[\033[38;5;15m\] > \[$(tput sgr0)\]\[\033[38;5;39m\]\w\[$(tput sgr0)\]\[\033[38;5;15m\] \\$ \[$(tput sgr0)\]"
alias fm="ssh [email protected] -t "./fm""

Learn Memory Proxy

worker_processes  2;

pid        /run/nginx.pid;

events {
    worker_connections  1024;
}
@cedced19
cedced19 / command-music.css
Created May 13, 2016 16:22
Command music player
/*
* Play and pause button thanks to Icono
*/
[class*="icono-"] {
display: inline-block;
vertical-align: middle;
position: relative;
font-style: normal;
color: #333;
text-align: left;
@cedced19
cedced19 / libsndfile.md
Created December 30, 2015 09:59
Use sndfile.h on Fedora
sudo yum install libsndfile-devel.*
@cedced19
cedced19 / emit.md
Created December 29, 2015 13:50
Ecouter http://live.bloguelinux.ca sur sa radio via son Raspberry pi

Tapez ces lignes de commandes:

git clone https://github.com/ChristopheJacquet/PiFmRds.git
cd PiFmRds/src
make clean
make
apt-get install sox
sox -t ogg http://live.bloguelinux.ca -t wav -  | sudo ./pi_fm_rds -freq 108 -rt "Bloguelinux.ca - Radio quebecoise" -audio -
@cedced19
cedced19 / pm2.md
Last active December 31, 2015 09:39
Restart all my softwares.
#!/bin/bash
nvm use 0.12
export NODE_ENV=production
cd /node/zikcenter/
pm2 start zikcenter.js
cd /node/learn-memory/bin/
pm2 start learn-memory
cd /node/raspberry/
pm2 start raspberry.js
@cedced19
cedced19 / git.md
Last active October 31, 2017 22:42
Create a Git Server.

See Git docs.

Add git user to sudoers:

sudo adduser git sudo

Change git shell:

sudo chsh git # and enter the path to git-shell, usually: /usr/bin/git-shell