Skip to content

Instantly share code, notes, and snippets.

View jbd's full-sized avatar

Jean-Baptiste Denis jbd

View GitHub Profile
@jbd
jbd / 01-form-single.html
Created November 22, 2023 10:25 — forked from ve3/01-form-single.html
Slice large file into chunks and upload using JavaScript.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>XHR upload large file with slice</title>
<style>
#debug {
border: 3px dashed #ccc;
margin: 10px 0;
padding: 10px;
@jbd
jbd / Makefile
Created September 15, 2023 09:45
LD_PRELOAD override to add AT_STATX_DONT_SYNC to the statx syscall flags
CC=gcc
CFLAGS=-shared -fPIC -Wall
LIBS=-ldl
TARGET=statx_dont_sync_override.so
SRC=statx_dont_sync_override.c
all: $(TARGET)
$(TARGET): $(SRC)
$(CC) $(CFLAGS) -o $(TARGET) $(SRC) $(LIBS)
# This is working without a virtualenv with
# bootstrap script version 20181121.101701
# See https://github.com/easybuilders/easybuild-framework/issues/2389
# for a bit more context
# Build the image with:
# sudo singularity build ebc7 ebc7.singularity
Bootstrap: docker
From: centos:7
from __future__ import print_function
import time
import os
import sys
import isi_sdk_8_1_0
from isi_sdk_8_1_0.rest import ApiException
from pprint import pprint
import urllib3
@jbd
jbd / listdir.py
Last active October 31, 2018 18:25
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
import stat
import argparse
import ConfigParser
import sqlite3
#!/usr/bin/env python
from influxdb import InfluxDBClusterClient
influx_host = "127.0.0.1"
influx_port = 8086
influx_user = "user"
influx_pass = "pass"
database = "example"
@jbd
jbd / centos7.singularity
Created July 27, 2018 09:26
vanilla centos 7 image with /pasteur directory
Bootstrap: docker
From: centos:7
%post
mkdir /pasteur
$ cat /home/eb/eb-Cvdx4V/easybuild-C8jsEA.log
== 2018-06-21 13:43:20,009 generaloption.py:1575 DEBUG generate_cmd_line no ignore
== 2018-06-21 13:43:20,009 generaloption.py:1606 DEBUG generate_cmd_line adding add-dummy-to-minimal-toolchains value False default found. Not adding to args.
== 2018-06-21 13:43:20,009 generaloption.py:1606 DEBUG generate_cmd_line adding aggregate-regtest value None default found. Not adding to args.
== 2018-06-21 13:43:20,009 generaloption.py:1606 DEBUG generate_cmd_line adding allow-loaded-modules value ('EasyBuild',) default found. Not adding to args.
== 2018-06-21 13:43:20,009 generaloption.py:1606 DEBUG generate_cmd_line adding allow-modules-tool-mismatch value False default found. Not adding to args.
== 2018-06-21 13:43:20,009 generaloption.py:1606 DEBUG generate_cmd_line adding allow-use-as-root-and-accept-consequences value False default found. Not adding to args.
== 2018-06-21 13:43:20,009 generaloption.py:1606 DEBUG generate_cmd_line adding amend value None default found.
@jbd
jbd / eb_hwloc.py
Created June 21, 2018 09:48
urllib2.URLError on CentOS 6.9
#!/usr/bin/env python
# generates urllib2.URLError: <urlopen error [Errno 1] _ssl.c:492: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure>
# on CentOS 6.9 with python 2.6.6
import urllib2
url = "https://www.open-mpi.org/software/hwloc/v1.6/downloads/hwloc-1.6.2.tar.gz"
url_req = urllib2.Request(url, headers={'User-Agent': 'EasyBuild', "Accept" : "*/*"})
urllib2.urlopen(url_req)
$ cat /home/eb/eb-zqnIyY/easybuild-QfVm7N.log
== 2018-06-21 09:41:51,969 generaloption.py:1575 DEBUG generate_cmd_line no ignore
== 2018-06-21 09:41:51,969 generaloption.py:1606 DEBUG generate_cmd_line adding add-dummy-to-minimal-toolchains value False default found. Not adding to args.
== 2018-06-21 09:41:51,969 generaloption.py:1606 DEBUG generate_cmd_line adding aggregate-regtest value None default found. Not adding to args.
== 2018-06-21 09:41:51,970 generaloption.py:1606 DEBUG generate_cmd_line adding allow-loaded-modules value ('EasyBuild',) default found. Not adding to args.
== 2018-06-21 09:41:51,970 generaloption.py:1606 DEBUG generate_cmd_line adding allow-modules-tool-mismatch value False default found. Not adding to args.
== 2018-06-21 09:41:51,970 generaloption.py:1606 DEBUG generate_cmd_line adding allow-use-as-root-and-accept-consequences value False default found. Not adding to args.
== 2018-06-21 09:41:51,970 generaloption.py:1606 DEBUG generate_cmd_line adding amend value None default found.