Skip to content

Instantly share code, notes, and snippets.

@avoidik
avoidik / soundnodeapp_429.md
Last active March 16, 2017 15:51
SoundnodeApp - solver 429 HTTP request error
  1. Request data with the help of python script:
import getpass
import json
import re
import requests

client_id = re.compile(',client_id:"(.*?)"').search(requests.get(re.compile('src="https://a-v2.sndcdn.com/assets/app-.*.js"').search(requests.get('https://soundcloud.com/').text).group()[5:-1]).text).group()[12:-1]

username = raw_input('Username: ')

Create new project, assign API key

https://console.developers.google.com/apis/api/

Set your own key with (REG_SZ strings)

HKEY_CURRENT_USER\SOFTWARE\Flavio Tordini\Minitube\googleApiKey 
HKEY_CURRENT_USER\SOFTWARE\Flavio Tordini\Musictube\googleApiKey
@avoidik
avoidik / readme.md
Last active June 1, 2017 09:05
upgrade apt from upstream

example is for trusty (14.04) and upstream is xenial (16.04)

  • cat /etc/apt/apt.conf.d/01ubuntu
APT::Default-Release "trusty";
  • cat /etc/apt/preferences.d/apt-fix-1001
@avoidik
avoidik / install.md
Created June 25, 2017 11:51
mingw toolchain

To install the MinGW toolchain (Reference):

  • Open MSYS2 shell from start menu
  • Run pacman -Sy pacman to update the package database
  • Re-open the shell, run pacman -Syu to update the package database and core system packages
  • Re-open the shell, run pacman -Su to update the rest
  • For 32-bits, run pacman -S mingw-w64-i686-toolchain
  • For 64 bits, run pacman -S mingw-w64-x86_64-toolchain
  • Select which package to install, default is all
  • You may also need make, run pacman -S make
# make sure to have these libs to compile Python with
sudo apt install -y libssl-dev openssl zlib1g-dev sqlite3 libsqlite3-dev libbz2-dev bzip2

# download pyenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenv

# put it in your path and initialize it, in .bashrc for example
export PATH="${HOME}/.pyenv/bin:${PATH}"
eval "$(pyenv init -)"
@avoidik
avoidik / readme.md
Created July 2, 2017 19:45
Rambox - Building on Ubuntu/Mint

Building Rambox from source

  • install npm via nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
source ~/.bashrc
nvm install 7
npm install -g npm
@avoidik
avoidik / README.md
Last active July 24, 2017 10:05
Uninstall, install and upgrade WSL LXSS

Uninstall

  • lxrun /uninstall /full
  • sc stop lxssmanager
  • rmdir /Q /S "\\?\C:\Users\Username\AppData\Local\lxss"

Install

  • sc start lxssmanager
  • lxrun /install

Upgrade 14.04 to 16.04

@avoidik
avoidik / docker-cleanup-resources.md
Created August 3, 2017 13:43 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@avoidik
avoidik / ANOTHER.md
Created August 18, 2017 08:24
docker cleaner
#!/bin/sh
docker images -q > /etc/docker-gc-exclude    # Save all genuine images as exclude
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /etc:/etc:ro spotify/docker-gc
@avoidik
avoidik / README.md
Last active October 5, 2017 11:45
Mémoriser-la-dernière-authentification-dans-OpenLDAP

Big Brother is watching you

Bien, pour débuter cet article, la première question qui se pose est : pourquoi mémoriser la date de dernière authentification ?

Une des raisons pourrait être de tracer l'activité des utilisateurs, pour être certain qu'ils se connectent au système et qu'ils travaillent... Mais le vrai intérêt est plutôt inverse : cette date permet d'identifier les comptes qui sont obsolètes dans l'annuaire, par exemple qui n'ont pas été utilisés pour s'authentifier depuis plusieurs mois.

Pas si simple

On pourrait croire que cette information est simple à récupérer, surtout dans OpenLDAP, l'annuaire LDAP de référence.