Charset tout pourri

convmv -f cp1252 -t utf-8 --notest * Téléversement sur un compte FTP avec un mauvais charset - Serveur en utf-8.

9 mars 2017 · 1 min

mysqldumpslow

Afin d’analyser rapidement un problème de reqûetes sur une base de données en temps et en nombre. Sur une instance MySQL ou MariaDB : activation des slowquery mysqldumpslow du fichiers de log

5 mars 2017 · 1 min

Redis Master & Slave

Redis master et slave avec réplication : À tester diskless :D https://redis.io/topics/replication

25 février 2017 · 1 min

Activation Tap Mouse

synclient TapButton1=1 synclient TapButton2=2 synclient TapButton3=3

29 décembre 2016 · 1 min

CPU governor

Certains serveurs ont par défaut un governor ondemand. Ce inline permet d’avoir toute la fréquence du CPU. echo performance| tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor >/dev/null

29 décembre 2016 · 1 min

Qtile config file

from libqtile import bar, hook, layout, widget from libqtile.command import lazy from libqtile.config import Click, Drag, Group, Key, Screen import subprocess import os @hook.subscribe.startup_once def autostart(): home = os.path.expanduser('~/.config/qtile/autostart.sh') subprocess.call([home]) @hook.subscribe.startup def dbus_register(): x = os.environ['DESKTOP_AUTOSTART_ID'] subprocess.Popen(['dbus-send', '--session', '--print-reply=string', '--dest=org.gnome.SessionManager', '/org/gnome/SessionManager', 'org.gnome.SessionManager.RegisterClient', 'string:qtile', 'string:' + x]) wmname = 'qtile' mod = 'mod4' # Key bindings keys = [ # multiple screens Key([mod], "z", lazy.to_screen(0)), Key([mod], "e", lazy.to_screen(1)), # Window manager controls Key([mod, 'control'], 'r', lazy.restart()), Key([mod, 'control'], 'q', lazy.shutdown()), Key([mod], 'r', lazy.spawncmd()), Key([mod], 'Return', lazy.spawn('terminator')), Key([mod], 'w', lazy.window.kill()), #Key([mod], 'Tab', lazy.layout.next()), Key([mod], 'Left', lazy.screen.prevgroup()), Key([mod], 'Right', lazy.screen.nextgroup()), # Layout modification Key([mod, 'control'], 'space', lazy.layout.toggle_split()), #Key([mod, 'control'], 'space', lazy.window.toggle_floating()), # Switch between windows in current stack pane Key([mod], 'k', lazy.layout.down()), Key([mod], 'j', lazy.layout.up()), # Move windows up or down in current stack Key([mod, 'control'], 'k', lazy.layout.shuffle_down()), Key([mod, 'control'], 'j', lazy.layout.shuffle_up()), # Switch window focus to other pane(s) of stack Key([mod], 'space', lazy.layout.next()), # Toggle between different layouts as defined below Key([mod], 'Tab', lazy.next_layout()), Key([], "XF86AudioRaiseVolume", lazy.spawn("amixer sset Master 5%+")), Key([], "XF86AudioLowerVolume", lazy.spawn("amixer sset Master 5%-")), ] # Mouse bindings and options mouse = ( Drag([mod], 'Button1', lazy.window.set_position_floating(), start=lazy.window.get_position()), Drag([mod], 'Button3', lazy.window.set_size_floating(), start=lazy.window.get_size()), ) bring_front_click = True cursor_warp = False follow_mouse_focus = False autosplit = True # Groups groups = [ Group('a'), Group('s'), Group('d'), Group('f'), Group('u'), Group('i'), Group('o'), Group('p'), ] for i in groups: # mod + letter of group = switch to group keys.append(Key([mod], i.name, lazy.group[i.name].toscreen())) # mod + shift + letter of group = switch to & move focused window to group keys.append(Key([mod, 'shift'], i.name, lazy.window.togroup(i.name))) dgroups_key_binder = None dgroups_app_rules = [] # Layouts layouts = [ layout.Max(), # layout.Stack(num_stacks=2), layout.Tile(), layout.RatioTile(), layout.Matrix(), ] floating_layout = layout.Floating() widget_defaults = dict( # font='Monospace', font='DejaVu Sans Mono', # font='Andika', fontsize=11, padding=3, ) # Screens and widget options screens = [ Screen( top=bar.Bar( widgets=[ widget.GroupBox( highlight_method='block', inactive='999999', fontsize=11 ), widget.Prompt(), widget.Sep(), widget.WindowName(), widget.Sep(), widget.CurrentLayout(), widget.Net(interface='eth0'), widget.Systray(), widget.Volume(), widget.Clock(format='%a %d %b %H:%M:%S %p'), ], size=24, background='#000000', ), ), Screen( top=bar.Bar( widgets=[ widget.GroupBox( highlight_method='block', inactive='999999', fontsize=11 ), widget.Sep(), widget.WindowName(), ], size=24, background='#000000', ), ), ]

29 décembre 2016 · 2 min

Awesome Python List

https://github.com/lk-geimfari/awesomo/blob/master/languages/PYTHON.md https://github.com/vinta/awesome-python

1 min