Skip to content

Instantly share code, notes, and snippets.

@ringods
ringods / import_to_pinboard.py
Created January 29, 2017 17:18
Pinboard Import Script
import csv
import json
import urllib
bookmark_file = '<bookmark_file_from_delicious>'
pinboard_token = '<your pinboard token>'
def process_tags(csv_tags):
json_tags = json.loads('{ "tags": %s }' % csv_tags)
json_tags = json_tags['tags']
@ringods
ringods / sitemap.conf
Created January 26, 2017 21:10
Delicious Bookmark Scraping
{
"_id": "delicious",
"selectors": [
{
"delay": "",
"id": "per_page_bookmarks_enumeration",
"multiple": false,
"parentSelectors": [
"_root"
],
version: '2'
services:
zookeeper:
image: "confluentinc/cp-zookeeper:4.1.0"
ports:
- "2181:2181"
expose:
- "2181"
environment:
- ZOOKEEPER_CLIENT_PORT=2181
@ringods
ringods / kops-cluster.yaml
Created February 22, 2017 16:23
Full kops specification with Cluster and InstanceGroups for masters and nodes
---
apiVersion: kops/v1alpha2
kind: Cluster
metadata:
name: kops.k8s-int-kops.skyscrape.rs
spec:
api:
loadBalancer:
type: Internal
subnets:
@ringods
ringods / output.log
Last active June 1, 2016 19:46
binding.read error
> @ images:watch /pipeline/source
> nodemon --watch ./src/images --ext gif,png,jpg -x "npm run images:build" --legacy-watch
fs.js:651
var r = binding.read(fd, buffer, offset, length, position);
^
Error: EBADF: bad file descriptor, read
at Error (native)
at Object.fs.readSync (fs.js:651:19)
@ringods
ringods / Vagrantfile
Created September 25, 2013 06:38
Vagrantfile for my Windows 2008R2 with WinRM activated, Puppet installed via MSI and failing the run via vagrant-windows.
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "windows2008r2"
config.vm.guest = :windows
# Max time to wait for the guest to shutdown
@ringods
ringods / addvirtualboxaccess.sh
Last active December 12, 2015 01:19
Console snippets for VirtualBox and raw disk setup.
root@host:~# usermod --groups disk -a virtualbox
@ringods
ringods / server.log
Created August 30, 2012 14:40
chef-validator: 401 Unauthorized problem
merb : chef-server (api) : worker (port 4000) ~ Started request handling: Thu Aug 30 16:38:43 +0200 2012
merb : chef-server (api) : worker (port 4000) ~ Routed to: {"admin"=>false, "action"=>"create", "controller"=>"clients", "name"=>"builder"}
merb : chef-server (api) : worker (port 4000) ~ Params: {"admin"=>false, "action"=>"create", "controller"=>"clients", "name"=>"builder"}
merb : chef-server (api) : worker (port 4000) ~ Failed to authenticate. Ensure that your client key is valid. - (Merb::ControllerExceptions::Unauthorized)
/usr/lib/ruby/gems/1.8/gems/chef-server-api-10.12.0/app/controllers/application.rb:56:in `authenticate_every'
/usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/controller/abstract_controller.rb:352:in `send'
/usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/controller/abstract_controller.rb:352:in `_call_filters'
/usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/controller/abstract_controller.rb:344:in `each'
/usr/lib/ruby/gems/1.8/gems/merb-core-1.1.3/lib/me
@ringods
ringods / SConstruct.py
Created January 30, 2012 15:53
env.Clone doesn't clone the builders and the emitters
# Configure base_env
base_env = Environment()
#...
# The snippet below enforces having different object instances of the builders
# to workaround the shallow copy of env.Clone()
other_env = base_env.Clone()
del other_env['BUILDERS']['StaticObject']
del other_env['BUILDERS']['SharedObject']
other_env.Tool('gcc')
@ringods
ringods / SConstruct.py
Created December 20, 2011 13:49
SCons snippet
env['LDFLAGS'] = "$_LIBDIRFLAGS $LINKFLAGS -ggdb3"
env.Execute("echo $LDFLAGS")
t = env.Command('$THIRD_PARTY/lib/libcurl.a',
'%s.tar.bz2' % name,
['mkdir -p $THIRD_PARTY/build',
'cd $THIRD_PARTY/build && tar jxf $THIRD_PARTY/%s' % zip_file,
'cd $THIRD_PARTY/build/%s && CFLAGS="$_CPPINCFLAGS $CCFLAGS $CFLAGS -ggdb3" CXXFLAGS="$_CPPINCFLAGS $CCFLAGS $CXXFLAGS -ggdb3" LDFLAGS="$LDFLAGS" ./configure --prefix=$THIRD_PARTY --without-ssl --with-pic --without-libssh2 --without-librtmp --without-libidn --without-axtls --without-ca-bundle --without-libssh2 --without-zlib --enable-static=yes --disable-shared --disable-ftp --disable-file --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smtp --disable-gopher --disable-sspi --disable-tls-srp --enable-ares' % name,