Skip to content

Instantly share code, notes, and snippets.

View overdrive3000's full-sized avatar
🇻🇪
de venezuela pa' españa

Juan Manuel Mesa overdrive3000

🇻🇪
de venezuela pa' españa
View GitHub Profile
@masihtehrani
masihtehrani / Spacevim.init.toml
Last active July 23, 2023 23:12
spacevim golang ide
#=============================================================================
# dark_powered.toml --- dark powered configuration example for SpaceVim
# Copyright (c) 2016-2017 Wang Shidong & Contributors
# Author: Wang Shidong < wsdjeg at 163.com >
# URL: https://spacevim.org
# License: GPLv3
#=============================================================================
[options]
lint_on_the_fly = true
@waltervargas
waltervargas / caesar-crack.hs
Created April 30, 2018 11:43
Caesar Crack Haskell Example
import Data.Char
positions :: Eq a => a -> [a] -> [Int]
positions x xs = [i | (x', i) <- zip xs [0..], x==x']
lowers :: String -> Int
lowers xs = length [x | x <- xs, x >= 'a' && x <= 'z']
count :: Char -> String -> Int
count x xs = length [x' | x' <- xs, x == x']
@J-L
J-L / gist:bea5b454fd0a8e2eb2381d1540520aca
Last active June 29, 2018 22:42
Python SigV4 Auth for AWS- Simple
# Key derivation functions. See:
# http://docs.aws.amazon.com/general/latest/gr/signature-v4-examples.html#signature-v4-examples-python
def sign(key, msg):
return hmac.new(key, msg.encode('utf-8'), hashlib.sha256).digest()
def getSignatureKey(key, dateStamp, regionName, serviceName):
kDate = sign(('AWS4' + key).encode('utf-8'), dateStamp)
kRegion = sign(kDate, regionName)
kService = sign(kRegion, serviceName)
@josegonzalez
josegonzalez / redis_migrate.py
Last active April 25, 2024 02:34 — forked from iserko/redis_migrate.py
A simple script to migrate all keys from one Redis to another
#!/usr/bin/env python
import argparse
import redis
def connect_redis(conn_dict):
conn = redis.StrictRedis(host=conn_dict['host'],
port=conn_dict['port'],
db=conn_dict['db'])
return conn
@talwrii
talwrii / jqcheatsheet.md
Last active December 16, 2020 15:13
jq cheatsheet

jq cheatsheet

Extract field from list of objects

jq 'map(.foo)'

[ { foo: 1 }, { foo: 2 } ]
[1, 2]
@jamiegs
jamiegs / BundleConfig.ps1
Created July 1, 2016 19:16 — forked from mefellows/BundleConfig.ps1
Sysprepped Windows AMI using Packer
$EC2SettingsFile="C:\\Program Files\\Amazon\\Ec2ConfigService\\Settings\\BundleConfig.xml"
$xml = [xml](get-content $EC2SettingsFile)
$xmlElement = $xml.get_DocumentElement()
foreach ($element in $xmlElement.Property)
{
if ($element.Name -eq "AutoSysprep")
{
$element.Value="Yes"
}
@sivel
sivel / go-build.sh
Last active September 28, 2023 18:40
Ansible Binary Golang Module
go build helloworld.go
GOOS=windows GOARCH=amd64 go build helloworld.go
@torgeir
torgeir / resize-home-folder-partition-on-ubuntu-snappy-core-on-the-raspberry-pi-2.md
Last active January 27, 2023 14:36
Resize home folder partition on ubuntu snappy core on the raspberry pi 2

Note where home is

(RaspberryPi2)root@localhost:~# df -h /home/
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p4   1.6G 1.3G   160M  89% /oem
(RaspberryPi2)root@localhost:~# df -h
@anex
anex / menu&groups
Created April 15, 2015 15:53
ir.ui.menu relation with groups openerp
<record id="original_module.menu_id" model="ir.ui.menu">
<field name="groups_id" eval="[(3,ref('my_new_group_id'))]"/>
</record>
There are actually0-6 numbers for representing each job for a many2many/ one2many field
(0, 0, { values }) -- link to a new record that needs to be created with the given values dictionary
(1, ID, { values }) -- update the linked record with id = ID (write values on it)
(2, ID) -- remove and delete the linked record with id = ID (calls unlink on ID, that will delete the object completely, and the link to it as well)
(3, ID) -- cut the link to the linked record with id = ID (delete the relationship between the two objects but does not delete the target object itself)
@wmealing
wmealing / C-states.md
Last active May 17, 2024 07:53
What are CPU "C-states" and how to disable them if needed?

To limit a CPU to a certain C-state, you can pass the processor.max_cstate=X option in the kernel line of /boot/grub/grub.conf.

Here we limit the system to only C-State 1:

    kernel /vmlinuz-2.6.18-371.1.2.el5 ... processor.max_cstate=1

On some systems, the kernel can override the BIOS setting, and the parameter intel_idle.max_cstate=0 may be required to ensure sleep states are not entered: