Skip to content

Instantly share code, notes, and snippets.

View codeshard's full-sized avatar
🎯
Focusing

Ozkar L. Garcell codeshard

🎯
Focusing
View GitHub Profile
dhcphelper:
image: homeall/dhcphelper:latest
container_name: dhcphelper
restart: always
environment:
IP: "172.31.0.100"
TZ: ${TZ}
privileged: true
network_mode: "host"
cap_add:
import re
(
CUENTA_MLC_METRO,
TARJETA_MLC_METRO,
CUENTA_MLC_BPA,
TARJETA_MLC_BPA,
CUENTA_MLC_BANDEC,
TARJETA_MLC_BANDEC,
) = (
# Use the front controller as index file. It serves as a fallback solution when
# every other rewrite/redirect fails (e.g. in an aliased environment without
# mod_rewrite). Additionally, this reduces the matching process for the
# start page (path "/") because otherwise Apache will apply the rewriting rules
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
DirectoryIndex index.php
# By default, Apache does not evaluate symbolic links if you did not enable this
# feature in your server configuration. Uncomment the following line if you
# install assets as symlinks or if you experience problems related to symlinks
# when compiling LESS/Sass/CoffeScript assets.
@codeshard
codeshard / 02-tuned.conf
Created February 20, 2017 17:55
ram improvements
vm.swappiness = 1
vm.overcommit_memory = 1
vm.vfs_cache_pressure = 1000
vm.dirty_background_ratio = 5
vm.dirty_ratio = 5
vm.dirty_background_bytes = 16777216
vm.dirty_bytes = 50331648
vm.drop_caches=3
fs.file-max = 2097152
#! ../env/bin/python
# -*- coding:utf-8 -*-
from ldap3 import Server, Connection, ALL, STRATEGY_SYNC, SEARCH_SCOPE_WHOLE_SUBTREE, ALL_ATTRIBUTES
class MigrateUsers(object):
def __init__(self, args=None):
"""Script para migrar CNs de un AD de Windows hacia un DC de Samba
En teoría debe funcionar con cualquier AD o DC
import os
def change_those(path):
to_remove = r'(Abdel La Esencia Y Estudios Odisea)'
paths = [os.path.join(path, file) for file in os.listdir(path) if to_remove in file]
for file in paths:
os.rename(file, file.replace(to_remove, ""))