Skip to content

Instantly share code, notes, and snippets.

Jean-Luc Lacroix esperlu

  • Regains SCS
  • Belgium
View GitHub Profile
@esperlu
esperlu / purge_non_existing_images.sh
Last active Nov 13, 2018
darktable: script to purge non existing images from DB (shell version with sqlite transaction)
View purge_non_existing_images.sh
#!/bin/sh
DRYRUN=yes
if [ "$1" = "-p" ]; then
DRYRUN=no
fi
DBFILE=~/.config/darktable/library.db
TMPFILE=$(mktemp -t tmp.XXXXXXXXXX)
@esperlu
esperlu / purge_non_existing_images.awk.sh
Last active Nov 13, 2018
darktable: script to purge non existing images from DB (awk version)
View purge_non_existing_images.awk.sh
#!/bin/sh
DRYRUN=yes
if [ "$1" = "-p" ]; then
DRYRUN=no
fi
DBFILE=~/.config/darktable/library.db
TMPFILE=$(mktemp -t tmp.XXXXXXXXXX)
@esperlu
esperlu / purge_non_existing_images.gawk.sh
Last active Nov 13, 2018
darktable: script to purge non existing images from DB (gawk version)
View purge_non_existing_images.gawk.sh
#!/bin/sh
DRYRUN=yes
if [ "$1" = "-p" ]; then
DRYRUN=no
fi
DBFILE=~/.config/darktable/library.db
TMPFILE=$(mktemp -t tmp.XXXXXXXXXX)
View LICENCE
The MIT License (MIT)
Copyright (c) 2015 esperlu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@esperlu
esperlu / mysql2sqlite.lua
Created May 26, 2011
MySQL to Sqlite converter in Lua
View mysql2sqlite.lua
#! /usr/bin/lua
-- Usage: mysql2sqlite.lua [data base name]
-- $ ./mysql2sqlite.lua my_database
-- $ ./mysql2sqlite.lua "my_database my_table"
-- $ ./mysql2sqlite
-- Set here the path to the temp file you want mysqldump to dump the database into
local mysqldump_file = '/tmp/lua.sql'
@esperlu
esperlu / mysql2sqlite.sh
Created Apr 27, 2011
MySQL to Sqlite converter
View mysql2sqlite.sh
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
You can’t perform that action at this time.