Skip to content

Instantly share code, notes, and snippets.

@nledez
nledez / gist:11348332
Created April 27, 2014 15:22
tdd-c-try-empty
nico@jerry ~/Devs/Embedded/nico ±master » make
rm -f build/*.o ; rm -f test1.out
gcc -Isrc -I../Unity/src -DTEST ../Unity/src/unity.c src/ProductionCode.c test/TestProductionCode.c test/test_runners/TestProductionCode_Runner.c -o test1.out
clang: error: no such file or directory: 'src/ProductionCode.c'
clang: error: no such file or directory: 'test/TestProductionCode.c'
clang: error: no such file or directory: 'test/test_runners/TestProductionCode_Runner.c'
make: *** [default] Error 1
@nledez
nledez / gist:11349219
Created April 27, 2014 16:03
"Undefined symbols for architecture x86_64"
nico@jerry ~/Devs/Embedded/code/SandBox » make
make -i -f MakefileCppUTest.mk
compiling AllTests.cpp
compiling LedDriverTest.cpp
compiling LedDriver.c
Building archive lib/libSandBox_CppUTest.a
ar: creating archive lib/libSandBox_CppUTest.a
a - objs/./src/LedDriver/LedDriver.o
Linking SandBox_CppUTest_tests
Undefined symbols for architecture x86_64:
### Keybase proof
I hereby claim:
* I am nledez on github.
* I am nledez (https://keybase.io/nledez) on keybase.
* I have a public key whose fingerprint is B3D4 F06F 8728 8566 2CF7 0F05 53AE 376C B253 0749
To claim this, I am signing this object:
@nledez
nledez / apache-default.rb
Last active August 29, 2015 14:10
Chef-Fundamentals_v2.1.3-nledez - Slide 379 (Ubuntu)
#
# Cookbook Name:: apache
# Recipe:: default
#
# Copyright 2014, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
#
#
@nledez
nledez / site-template-ssl
Created December 10, 2014 12:17
An ssl reverse proxy with Nginx
upstream {{ hostname }} {
server {{ remote }};
}
# HTTPS server
server {
listen 443;
server_name {{ hostname }};
@nledez
nledez / header_checks
Created March 17, 2015 17:39
Antispam computerfutures.fr
/^From: .*@computerfutures\.fr.*$/ REJECT Je vous ai deja dit que je ne voulais plus vos mails
for c in server.startssl.crt sub.class1.server.ca.pem server.crt ; do
echo "======== $c"
cat $c
done
@nledez
nledez / pushsshkey.py
Last active August 29, 2015 14:21
_module/pushsshkey.py
import salt.loader
def get_user_key(username):
__states__ = salt.loader.states(__opts__, __salt__)
out = ''
for key in __pillar__.get('ssh_keys', {}).get(username, {}).get('ssh_auth', []):
__states__['ssh_auth.present'](key, 'root')
out += '{}\n'.format(key)
@nledez
nledez / gist:49d7d583f9675c83c754
Created June 19, 2015 15:17
Install from the internet
{curl,wget -O -} http://{debian,ubuntu}.cozycloud.cc/install-cozy-{debian-jessie,ubuntu-trusty}.sh | [get_cmd=curl] {ba,z,}sh -
curl http://debian.cozycloud.cc/install-cozy-debian-jessie.sh | get_cmd=curl sh -
wget -O - http://debian.cozycloud.cc/install-cozy-debian-jessie.sh | bash -
curl http://ubuntu.cozycloud.cc/install-cozy-ubuntu-trusty.sh | get_cmd=curl zsh -
And all other variations...
The only limitation is in URL:
http://debian.cozycloud.cc/install-cozy-debian-jessie.sh
@nledez
nledez / gist:0e5addd0f297b42007da
Created December 26, 2015 10:41
New Cozy Cloud Raspberry π image (2.0.0)
wget https://files.cozycloud.cc/cozy-raspberrypi-2.0.0-rc1.zip
unzip cozy-raspberrypi-2.0.0-rc1.zip
sudo dd bs=bs=1M if=cozy-raspberrypi-2.0.0.img of=/dev/sdX # Put your sd card device here
# On first boot:
ssh pi@<ip>
# password: raspberry
sudo -s