Skip to content

Instantly share code, notes, and snippets.

@ilyash
ilyash / webkit-background-image-wrapping-bug.html
Created September 1, 2012 10:07
Webkit background image wrapping bug
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Webkit background image wrapping bug</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
<br/>
50x40px div. background-image - 40x1 px, 37 top pixels transparent, 3 bottom pixes are red, green and blue from top to bottom. Followed by 50x40px div with background-color #888:<br/><br/>
@ilyash
ilyash / ec2-instance-types-table.py
Last active February 20, 2023 11:54
Quick hack to create CSV containing AWS EC2 instance types with their properties. This format is more convenient (at least for me) than the types page.
#!/usr/bin/python
'''
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@ilyash
ilyash / gist:6363673
Last active December 21, 2015 20:49
Quick and dirty hosts' file lines from Chef
knife exec -E 'nodes.all.sort_by(&:name).each do |node| puts "#{printf "%-16s",node.ipaddress} #{node.name}" end'
# or
knife exec -E 'nodes.all.sort_by(&:ipaddress).each do |node| puts "#{printf "%-16s",node.ipaddress} #{node.name}" end'
@ilyash
ilyash / copy_sys_pkg_to_virtualenv.sh
Last active January 1, 2016 03:59
Python - copy system package to virtualenv (example)
tar -h -C /usr/lib/python2.7/dist-packages -czf netaddr.tgz netaddr netaddr-0.7.10.egg-info
tar -C $VIRTUAL_ENV/lib/python2.7/site-packages/ -xzf netaddr.tgz
@ilyash
ilyash / cloudify-vimrc
Created March 11, 2014 11:09
Suggested .vimrc lines for Cloudify
" GigaSpaces Cloudify settings, excerpt from my .vimrc + additional comments
" * CTRL+F9 to run flake QuickFix, CTRL+Enter/Shift+CTRL+Enter to navigate
" * Tabulation settings. You might need to adjust the folder name "gigaspaces"
map <C-F9> :make<CR>
noremap <C-CR> :cn<CR>:cc<CR>
noremap <S-C-CR> :cN<CR>:cc<CR>
hi CursorLine guibg=#F4F4F4
@ilyash
ilyash / cloudify-chef-plugin-client-node-example.yaml
Created May 12, 2014 14:33
Cloudify Chef Plugin - client node example
- name: chef_node_one
type: cloudify.types.chef.db_server
properties:
chef_config:
version: 11.10.4-1
chef_server_url: https://chef.example.com:443
validation_client_name: chef-validator
validation_key: "-----BEGIN RSA PRIVATE KEY-----\n.......\n-----END RSA PRIVATE KEY-----\n"
node_name_prefix: chef-node-
node_name_suffix: .chef.example.com
@ilyash
ilyash / cloudify-chef-plugin-related-solo-nodes.yaml
Created May 12, 2014 14:35
Cloudify Chef Plugin - related solo nodes
# WARNING:
# /etc/sudoers must not have "Default requiretty" for Puppet plugin to work
imports:
- http://www.getcloudify.org/spec/cloudify/3.0/types.yaml
plugins:
puppet_plugin:
derived_from: cloudify.plugins.agent_plugin
@ilyash
ilyash / install-cloudify-master.sh
Created August 19, 2014 08:46
Install Cloudify from master
# In new virtualenv:
PACKAGES="cloudify-dsl-parser cloudify-rest-client cloudify-cli cloudify-openstack-provider"
for pkg in $PACKAGES;do
pip install --upgrade https://github.com/Cloudify-Cosmo/$pkg/archive/master.zip
done
# WARNING:
# /etc/sudoers must not have "Default requiretty" for Puppet plugin to work
imports:
- http://www.getcloudify.org/spec/cloudify/3.1/types.yaml
plugins:
puppet_plugin:
derived_from: cloudify.plugins.agent_plugin