Skip to content

Instantly share code, notes, and snippets.

View printminion's full-sized avatar
💭
Time flies like an arrow; fruit flies like a 🍌

@printminion printminion

💭
Time flies like an arrow; fruit flies like a 🍌
View GitHub Profile
username: vagrant
password: vagrant
sudo apt-get update
sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev
sudo aptitude install mysql-server mysql-client
sudo nano /etc/mysql/my.cnf
@printminion
printminion / cajaTwitterAuth.js
Last active August 29, 2015 13:57
Caja-safe server polling. Using setTimeout for calling each 3 seconds remote method isUserConnectedToTwitter. Code taken from https://chrome.google.com/webstore/detail/twitter-curator/bfibcmjdlcklcgcifiaclckmnklmndmp
/*
* Program rewritten to mitigate differences between
* Caja and strict-mode JavaScript.
* For more see * https://code.google.com/p/google-caja/wiki/SES#Source-SES_vs_Target-SES
*/
(1, $)(function() {
(1, checkForOAuthKey)();
(1, $)('#start-twitter-auth').click(startTwitterSignIn);
(1, $)('#load_tweets').click(function() {
(1, $)('#loading').fadeIn('slow', function() {
How to turn your Chromebook/Chromebox into a cloud development machine in 12 easy steps.
1. Enabled Developer Mode
http://www.chromium.org/chromium-os/poking-around-your-chrome-os-device
2. Download crouton
https://github.com/dnschneid/crouton
3. Open crosh (Chrome OS Developer Shell)
CTRL-ALT-T
sha256sum -b ./dbapp.war > ./dbapp.sha256
gsutil cp ./dbapp.war ./dbapp.sha256 gs://stathy/${JOB_NAME}/${BUILD_NUMBER}/
gsutil setacl public-read gs://stathy/${JOB_NAME}/${BUILD_NUMBER}/dbapp.war
gsutil setacl public-read gs://stathy/${JOB_NAME}/${BUILD_NUMBER}/dbapp.sha256
cd ${WORKSPACE}
gcutil addinstance dbapp-db dbapp-app1 dbapp-lb \
--project "opscode.com:stathy" --image "/projects/opscode.com:stathy/images/centos-latest" \

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

#--------- stop instance -----
#connect and shutdown
gcutil --project=$PROJECT ssh $INSTANCE
sudo shutdown -h now
# check
gcutil listinstances --project $PROJECT
#delete instance/keep boot disk , use -f to avoid confirmation
gcutil --project=$PROJECT deleteinstance $INSTANCE --nodelete_boot_pd
# check disks
gcutil listdisks --project=$PROJECT
@printminion
printminion / udacityio.sh
Last active August 29, 2015 14:00
Script for getting youtube_id of udacity course videos. Set proper cookie value ans run it like ./get_course.sh cs255
#!/bin/bash
COURCEID=$1
mkdir $COURCEID
#set your udacity cookie here - just in case
MY_COOKIE='cookie: __unam=bla-bla-bla; optimizelyEndUserId=bla;'
#read course data
curl 'https://www.udacity.com/api/nodes/'$COURCEID'?depth=1&fresh=false&required_behavior=view&projection=navigation' \
#!/usr/bin/python
# -*- coding: utf-8 -*-
import pprint
from gapps.auth import Auth
__author__ = 'm.kupriyanov'
import settings
@printminion
printminion / designer.html
Last active August 29, 2015 14:10
designer
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../paper-toggle-button/paper-toggle-button.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../paper-radio-group/paper-radio-group.html">
<link rel="import" href="../paper-radio-button/paper-radio-button.html">
<link rel="import" href="../paper-button/paper-button.html">
<polymer-element name="my-element">
<template>
@printminion
printminion / killgittags.sh
Created November 25, 2014 16:33
kill all the tags with "live" in int
#!/bin/bash
#kill all tags with "live" in int
git tag -l | grep live | xargs -I {} git tag -d {} | awk '{print $3}' | sed s/\'//g | xargs -I {} git push origin :refs/tags/{}