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
@rcoup
rcoup / aws_usage.py
Created June 1, 2010 21:46
A script to query the Amazon Web Services (S3/EC2/etc) usage reports programmatically.
#!/usr/bin/env python
"""
A script to query the Amazon Web Services usage reports programmatically.
Ideally this wouldn't exist, and Amazon would provide an API we can use
instead, but hey - that's life.
Basically takes your AWS account username and password, logs into the
website as you, and grabs the data out. Always gets the 'All Usage Types'
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 21, 2024 20:54
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@afair
afair / tmux.cheat
Last active June 3, 2024 23:26
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New new -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &
@sighmin
sighmin / Loops and Functions Go Tour Exercise
Last active August 21, 2019 18:39
Go tour sqrt VS newton's method: http://tour.golang.org
package main
import (
"fmt"
"math"
)
func Newt(x float64) float64 {
if x == 0 { return 0 }
z := 1.0
@jdewit
jdewit / vim74_lua
Last active January 30, 2024 04:57
Installing vim 7.4 with lua on Ubuntu 12.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get build-dep vim-gnome
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo rm -rf /usr/local/share/vim
sudo rm /usr/bin/vim
@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:

@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)
@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
@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
@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"
}