Skip to content

Instantly share code, notes, and snippets.

@M0dM
M0dM / shortcuts.sh
Last active January 19, 2023 09:21
Gnome switch workspace with: Super + Number
#!/bin/bash
echo "Setting shortcuts...\n"
gsettings set org.gnome.mutter dynamic-workspaces false
gsettings set org.gnome.desktop.wm.preferences num-workspaces 10
gsettings set org.gnome.shell.keybindings switch-to-application-1 []
gsettings set org.gnome.shell.keybindings switch-to-application-2 []
gsettings set org.gnome.shell.keybindings switch-to-application-3 []
gsettings set org.gnome.shell.keybindings switch-to-application-4 []
@M0dM
M0dM / shell_invoke.sh
Created April 28, 2022 12:21 — forked from Miserlou/shell_invoke.sh
Execute Lambda Shell Commands With Zappa
zappa invoke --raw 'import subprocess; print subprocess.check_output("ls");'
@M0dM
M0dM / zappa_lambdawarmer.diff
Created February 28, 2019 10:36
Integrate lambdawarmer with zappa
--- unzipped2/zappa/handler.py 1980-01-01 00:00:00.000000000 +0100
+++ unzipped/zappa/handler.py 2019-02-28 11:04:44.445385373 +0100
@@ -576,9 +576,15 @@
return content
-def lambda_handler(event, context): # pragma: no cover
- return LambdaHandler.lambda_handler(event, context)
+try:
+ import lambdawarmer
func = lambda *args, **kwars: (args, kwargs)
@M0dM
M0dM / Custom_logstash_log_line_reference_field.md
Last active August 29, 2015 14:25
Custom logstash log line reference field

Add line reference value to logstash parsed log field

Issue: Diffrents log with same datetime not ordered inside kibana

Solution:

  • Add log line reference to filewatch library to be able to know which line is before the over inside the file
  • Add this information to the path field to be able to access this value from logstash config file
  • Get the value inside the logstash configuration file using a simple grok filter on the path field file: logstash-1.4.2/vendor/bundle/jruby/1.9/gems/filewatch-0.5.1/lib/filewatch/tail.rb

Modifications