Skip to content

Instantly share code, notes, and snippets.

💭
Not liking the clutterful GitHub

Olivier Mehani shtrom

💭
Not liking the clutterful GitHub
Block or report user

Report or block shtrom

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@shtrom
shtrom / staticVsSelf.php
Last active Mar 25, 2019
`static` vs `self`
View staticVsSelf.php
<?php
class VarHolder {
const VAR = 2;
public function showVar() {
echo self::VAR;
echo static::VAR;
}
}
View complexity.c
int doSomething(int n)
{
for (int i = 1; i <= n; i++)
{
for (int j = 1; j < n; j += i)
{
// Some O(1) task
}
}
}
@shtrom
shtrom / fritz_cert_upload.py
Last active Jul 28, 2019
Upload a TLS key and cert to a FRITZ!Box, in pretty Python
View fritz_cert_upload.py
#!/usr/bin/env python
# vim: fileencoding=utf-8
"""
Upload a TLS key and cert to a FRITZ!Box, in pretty Python
Copyright (C) 2018 Olivier Mehani <shtrom@ssji.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
@shtrom
shtrom / fritzbox-cert-update.sh
Created Jan 28, 2018 — forked from wikrie/fritzbox-cert-update.sh
Fritzbox Fritz!Box AVM SSL Letsencrypt automatically update
View fritzbox-cert-update.sh
#!/bin/bash
# parameters
USERNAME="maybe empty"
PASSWORD="fritzbox-password"
CERTPATH="path to cert eg /etc/letsencrypt/live/domain.tld/"
CERTPASSWORD="cert password if needed"
HOST=http://fritz.box
# make and secure a temporary file
@shtrom
shtrom / wallabag19-export.php
Created Nov 27, 2016
Export Wallabag 1.9 (and maybe other 1.x) library.
View wallabag19-export.php
<?php
/* Export Wallabag 1.9 (and maybe other 1.x) library.
*
* Olivier Mehani <shtrom+wallabag@ssji.net>, 2016
* MIT license (same as Wallabag itself)
*
* Particularly useful in * case the normal export process dies with a message
* such as
*
* PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 74558957 bytes) in /srv/www/wallabag/inc/poche/Tools.class.php on line 231
@shtrom
shtrom / openldap_passwd.py
Last active Dec 6, 2017 — forked from rca/openldap_passwd.py
Python hashing and test functions for user passwords stored in OpenLDAP.
View openldap_passwd.py
#!/usr/bin/env python
"""
http://www.openldap.org/faq/data/cache/347.html
As seen working on Ubuntu 12.04 with OpenLDAP 2.4.28-1.1ubuntu4
Author: Roberto Aguilar <roberto@baremetal.io>
"""
import hashlib
import os
@shtrom
shtrom / openpgp.txt
Created May 10, 2016
OpenKeychain Linked Identity
View openpgp.txt
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:4435cf6a7c8ddd9be2def5f9f012a6e298c66655]
View keybase.md

Keybase proof

I hereby claim:

  • I am shtrom on github.
  • I am shtrom (https://keybase.io/shtrom) on keybase.
  • I have a public key whose fingerprint is 4435 CF6A 7C8D DD9B E2DE F5F9 F012 A6E2 98C6 6655

To claim this, I am signing this object:

@shtrom
shtrom / graphite-web.rc
Created Jul 30, 2012
ArchLinux rc.d script for AUR package graphite-web
View graphite-web.rc
#!/bin/bash
daemon_name=graphite-web
. /etc/rc.conf
. /etc/rc.d/functions
get_pid() {
echo `ps ax | grep [c]arbon-cache.py | awk '{ print $1; }'; \
ps ax | grep [u]wsgi-graphite.yaml | awk '{ print $1; }'`
You can’t perform that action at this time.