Skip to content

Instantly share code, notes, and snippets.

View bertrandmartel's full-sized avatar
💤
👀

Bertrand Martel bertrandmartel

💤
👀
View GitHub Profile
@bertrandmartel
bertrandmartel / parse_file.sh
Last active August 29, 2015 14:27
[ STACK OVERFLOW ] Parse filename Temperature_XX_Volumn_XX.dat with file name values to a single csv file
#!/bin/bash
#title :parse_file.sh
#description :parse file name into a single file
#author :Bertrand Martel
#date :13/08/2015
file_list=`ls $1`
IFS=$'\n' #line delimiter
@bertrandmartel
bertrandmartel / dateRange.html
Last active August 29, 2015 14:27
[ DateTimePicker Issue ] Range between dates with plus one day value
<!DOCTYPE html>
<html>
<head>
<title>Range between dates with plus one day value</title>
<script src="http://momentjs.com/downloads/moment.min.js"></script>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="./jquery.datetimepicker.min.css"/>
<script>
@bertrandmartel
bertrandmartel / format_awk_grep.sh
Last active August 29, 2015 14:27
[ STACKOVERFLOW ] format text which match specific pattern showing it only with grep notation and awk notation
#!/bin/bash
IFS=$'\n' #line delimiter
#empty your output file
cp /dev/null "$2"
for i in $(cat "$1"); do
is_gin=`echo $i | grep "GIN+"`
@bertrandmartel
bertrandmartel / structure_nest.cpp
Created August 14, 2015 17:16
[ STACKOVERFLOW ] structure nest C++
struct dmentry{
int func;
struct dmarray *dmarray;
};
struct dmparam {
char *p;
char *v;
@bertrandmartel
bertrandmartel / mongod.sh
Created August 15, 2015 05:41
mongod service init.d launcher script
#!/bin/sh
#title :mongod
#author :Bertrand Martel
#date :15/08/2015
#description :start/stop/restart mongod
#########################################
### install : cp mongod /etc/init.d/
# update-rc.d mongod defaults
### uninstall : update-rc.d -f mongodb remove
@bertrandmartel
bertrandmartel / ffmpeg.sh
Created August 16, 2015 02:41
ffmpeg create a video from a sequence of image and add a new image to video
########################################################################
# create a video from one or several images in sequence ################
########################################################################
#create a video from input image ( with name image1.jpg image2.jpg image3.jpg ...) with a framerate of 1 image per second
ffmpeg -f image2 -pattern_type sequence -start_number 0 -r 1 -i picture%d.jpg -s 1920x1080 picture.avi
########################################################################
# add an image to video ################################################
########################################################################
@bertrandmartel
bertrandmartel / append_video.sh
Last active August 29, 2015 14:27
[ BASH ] create a video if not exist and append a series of image to this video taken from WEB (input working directory)
#/bin/bash
#title :append_new_picture.sh
#author :Bertrand Martel
#date :16/08/2015
#description :create video if not exist and append a series of image to this video taken from WEB
if [ -z $1 ]
then
echo "output directory is required"
exit
@bertrandmartel
bertrandmartel / android_service.png
Last active August 29, 2015 14:27
[ SHELL ] Start / Stop / show service status (usage is : ./android_services.sh [start/stop/ps]
android_service.png
@bertrandmartel
bertrandmartel / associative_map.sh
Created August 18, 2015 00:48
[ LINUX BASH ] Associate map : get / set / insert
#!/bin/bash
declare -A map=([toto]=1 [tata]=2)
YOUR_STRING="titi"
CHECK=`echo "${!map[@]}" | grep -o $YOUR_STRING`
if [ -z $CHECK ]; then
#create the entry for it and set its count (value) to 1
@bertrandmartel
bertrandmartel / pkcs7-pubkey.png
Last active August 29, 2015 14:27
[ OPENSSL - ANDROID ] display public key of PKCS 7 certificate
pkcs7-pubkey.png