Skip to content

Instantly share code, notes, and snippets.

View netmonk's full-sized avatar
🏠
Working from home

Netmonk netmonk

🏠
Working from home
View GitHub Profile
@netmonk
netmonk / gist:9852338
Created March 29, 2014 10:55
A python Sierpinsk Quine
a = '''a = ''{0}'' # /\
# /\/\
def sierp(x): # /\ /\
if x == 1: # /\/\/\/\
yield '/%c' % 92 # /\ /\
else: # /\/\ /\/\
for i in sierp(x-1): # /\ /\ /\ /\
yield i.center(2**x) # /\/\/\/\/\/\/\/\
for i in sierp(x-1): # /\ /\
yield i+i # /\/\ /\/\
@netmonk
netmonk / gene.py
Last active August 29, 2015 14:01
Genetic algorithm as described in Linux Magazine May 2014 (French edition)
import random
import sys
def chromosome_initial(nb_genes=12, taille_gene=4):
chromosome =""
for i in range(nb_genes):
for j in range(taille_gene):
chromosome += str(random.randint(0,1))
return chromosome
:: Procéder à l’installation ? [O/n]
(84/84) vérification des clés dans le trousseau [##############################] 100%
(84/84) vérification de l’intégrité des paquets [##############################] 100%
(84/84) chargement des fichiers des paquets [##############################] 100%
(84/84) analyse des conflits entre fichiers [##############################] 100%
erreur : la validation de la transaction a échoué (conflit de fichiers)
pyqt4-common : /usr/bin/pylupdate4 est déjà présent dans le système de fichiers
pyqt4-common : /usr/bin/pyrcc4 est déjà présent dans le système de fichiers
pyqt4-common : /usr/share/qt4/qsci/api/python/PyQt4.api est déjà présent dans le système de fichiers
python2-pyqt4 : /usr/bin/python2-pyuic4 est déjà présent dans le système de fichiers
[root(4)netmonk:plonky]# LC_ALL=C pacman -Suy
:: Synchronizing package databases...
core is up to date
extra 1743.5 KiB 1030K/s 00:02 [##############################] 100%
community 2.3 MiB 1034K/s 00:02 [##############################] 100%
:: Starting full system upgrade...
:: Replace polkit-qt with extra/polkit-qt4? [Y/n] y
resolving dependencies...
looking for inter-conflicts...
https://www.ditchthecarbs.com/keto-waffles/
---
- name: Collect primary rebond server sshd keys files
slurp: src={{ item }}
with_items:
- /etc/ssh/ssh_host_rsa_key.pub
- /etc/ssh/ssh_host_rsa_key
- /etc/ssh/ssh_host_ecdsa_key.pub
- /etc/ssh/ssh_host_ecdsa_key
- /etc/ssh/ssh_host_ed25519_key.pub
- name: bddeploy | Importing SAE sql schemes
#delegate_to: "{{ ansible_ssh_host }}"
mysql_db:
state: import
name: "{{ dbname_tango }}"
login_host: "{{ dbhost_tango }}"
login_user: "{{ dbadmin }}"
login_password: "{{ dbadminpassword }}"
target: "{{app_dir }}/{{ release_name}}/sql/{{ item }}"
with_items: "{{ lookup('file', '{{ app_dir }}/{{ release_name }}/sql/list.sae_full.scripts').splitlines() }}"
- name: bddeploy | Creating release folder
file:
path: "{{ item }}"
owner: "{{ appuser }}"
state: directory
mode: 0744
with_items:
- "{{ app_dir}}/{{ release_name}}"
# on telecharge l'archive tango
- debug:
msg: dbname of {{ inventory_hostname }} is {{ dbname_tango}}
# au préalable il faut un endroit pour recevoir l'archive tango
- name: bddeploy | Creating release folder
file:
path: "{{ item }}"
owner: "{{ appuser }}"
state: directory
mode: 0744
with_items:
---
#ce role sert à créer les bases de données tango
- debug:
msg: dbname of {{ inventory_hostname }} is {{ dbname_tango}}
# au préalable il faut un endroit pour recevoir l'archive tango
- name: bddeploy | Creating release folder
file:
path: "{{ item }}"