Skip to content

Instantly share code, notes, and snippets.

@cjlano
cjlano / README.md
Last active June 7, 2021 23:38
Nextcloud OVH object storage as primary storage

Use OVH Public Cloud Object Storage as "Primary Storage" in Nextcloud configuration

Pointers:

Instructions

Download the "openRC.sh": https://www.ovh.com > My Account > Public Cloud > Project Management / Users & roles > Your user > (...) > Download openStack RC file

All OS_ variable should be replaced by their value in config.php

richardbarry = Richard Barry <[email protected]>
RichardBarry = Richard Barry <[email protected]>
rtel = Real Time Engineers ltd. <[email protected]>
# vim: ft=zsh
# Derivated from oh-my-zsh Bureau Theme
### Git [±master ▾●]
ZSH_THEME_GIT_PROMPT_PREFIX="‹%{$fg_bold[green]%}±%{$reset_color%}%{$fg[yellow]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}›"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%}✓%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[cyan]%}▴%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_BEHIND="%{$fg[magenta]%}▾%{$reset_color%}"
# DuckDuckGo (sudo pip install duckduckgo)
>>> import duckduckgo
>>> r = duckduckgo.query("ip address")
>>> r.answer.text
'Your IP address is ...'
>>> import re
>>> address_regexp = re.compile ('\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}')
>>> result = address_regexp.search( r.answer.text )
>>> result.group()
'xx.xx.xx.xxx'
Informations techniques http://www.degrouptest.com/
longueur de ligne :3640 mètres
affaiblissement théorique : 38.667dB
état de la ligne : ACTIVE
débit maximum estimé ADSL : 8.07 Mbps
http://mafreebox.free.fr/pub/fbx_info.txt
______________________________________________________________________
@cjlano
cjlano / list_files.py
Created July 8, 2013 10:24
List directory tree structure sorted by file size using Python Based on http://stackoverflow.com/questions/9727673/list-directory-tree-structure-using-python
def list_files(startpath):
for root, dirs, files in os.walk(startpath):
level = root.replace(startpath, '').count(os.sep)
indent = ' ' * 4 * (level)
print('{}{}/'.format(indent, os.path.basename(root)))
subindent = ' ' * 4 * (level + 1)
for f in sorted(files, key=lambda f: os.path.getsize(root + os.sep + f)):
print('{}{} - {}B'.format(subindent, f, os.path.getsize(root + os.sep + f)))
@cjlano
cjlano / bezier.py
Last active December 14, 2015 15:39 — forked from anonymous/bezier.py.txt
plot bezier curve from SVG
import os
import Image, ImageDraw
def bezier1(p0, p1, t):
x = p0[0] + t * (p1[0] - p0[0])
y = p0[1] + t * (p1[1] - p0[1])
return (x,y)
def bezierN(pts, t):
res = list(pts)
@cjlano
cjlano / bezier.c
Created February 28, 2013 14:57 — forked from anonymous/bezier.c.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <math.h>
struct image {
uint32_t size_x;
uint32_t size_y;
uint8_t* pixels;
@cjlano
cjlano / vusb-download.sh
Created September 11, 2012 16:42
V-USB history download
# Get the download page src
wget http://www.obdev.at/products/vusb/download.html
# Find all unique tar.gz in the page
# Who can do a nicer 'sed' invocation ?
sed -rn "s|/downloads/vusb/[a-z0-9-]+\.tar\.gz|\n\nhttp://www.obdev.at&\n\n|gp" < download.html | grep '^http' | sort -u | xargs wget
#make a git repo out of it...