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
@printminion
printminion / README.md
Last active January 2, 2017 21:01
Shoot timelaps with the py Camera with raspberry Zero and move it to Google Cloud Storage

#Add two chronjobs for shooting images and uploadng to GCS

sudo crontab -e
#start camera script on startup
@reboot sudo -u pi /usr/bin/python /home/pi/timelaps/timelaps.py 2>&1 | /usr/bin/logger -t TL_CAM

#run movetogcs.sh file once per minute - ony one instance is allowed 
* * * * * /usr/bin/flock -n /tmp/movetogcs.lockfile sudo -u pi /home/pi/timelaps/movetogcs.sh 2>&1 | /usr/bin/logger -t TL_MOVETOGCS
@printminion
printminion / certbot-renew.sh
Created June 3, 2016 19:39
renew ssl letsencrypt certificate on bitnami server
#!/bin/bash
#renew ssl letsencrypt certificate on bitnami server
#https://gist.github.com/printminion/6ec2fc0fefaba8e0a98a63a6d73b0802/edit
sudo /opt/bitnami/ctlscript.sh stop apache
cd /home/user/certbot
#./certbot-auto certonly --standalone -w /opt/bitnami/apache2/conf/ -d example
.com -d www.example.com
./certbot-auto renew
sudo cp /etc/letsencrypt/live/example.com/fullchain.pem /opt/bitnami/apache2/conf/server.crt
@printminion
printminion / test_duplicates.sh
Created April 4, 2016 15:17
Check files if they have duplicated lines
#!/usr/bin/env bash
# @desc Check files if they have duplicated lines
# @author Misha M.-Kupriyanov https://google.com/+MishaMKupriyanov
# @link https://gist.github.com/printminion/abbac1dcd7b123d67b510b5272220c5b
if [ -z "$1" ]
then
echo "Usage:"
echo " ./test_duplicates.sh *.csv - test all files in folder"
@printminion
printminion / 1_drawable_ic_hash_io16.xml
Created March 18, 2016 11:33 — forked from nickbutcher/1_drawable_ic_hash_io16.xml
Animated Stroke. The google I/O website this year (https://google.com/io) has some funky animated lettering. I especially liked the animated stroke around the letters and wondered how you might implement that on Android. Turns out that AnimatedVectorDrawable makes this very easy! Here's how it looks: https://twitter.com/crafty/status/71077957997…
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@printminion
printminion / Code.gs
Created February 19, 2016 18:10 — forked from erickoledadevrel/Code.gs
Create a Google Calendar event with an attachment in Apps Script
function createEventWithAttachment() {
var driveFileId = '...';
var file = DriveApp.getFileById(driveFileId);
var event = {
summary: 'Test Event with Attachments',
description: 'Woot!',
attachments: [{
fileId: driveFileId,
fileUrl: file.getUrl(),
mimeType: file.getMimeType(),
@printminion
printminion / magento_blocks_log.php
Created February 17, 2016 15:38
Output content of Blocks to Log file
$output = '===============================================================' . PHP_EOL;
//$output .= 'START:' . $ctrl->getFullActionName() . PHP_EOL;
$output .= 'START:' . PHP_EOL;
$blocks = Mage::app()->getLayout()->getAllBlocks();
foreach ($blocks as $blockName => $block) {
$output .= 'BLOCK: ' . $blockName . PHP_EOL;
//$output .= $observer->getLayout()->getBlock($blockId )->toHTML();
$output .= $block->toHTML();
$output .= PHP_EOL . PHP_EOL;
@printminion
printminion / gtm-container-compare.py
Last active December 11, 2023 05:22
compare two gtm containers
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
@desc Compare two Goolge Tag Manager containers
@author Misha M.-Kupriyanov https://google.com/+MishaMKupriyanov
@link https://gist.github.com/printminion/9cae259c6c7220ea1540
"""
#!/usr/bin/python
import os
import sys
import csv
import datetime
import time
import twitter
def test():
@printminion
printminion / config.yaml
Created January 6, 2016 16:56 — forked from jahvi/config.yaml
PuPHPet Magento 1 and 2 config
vagrantfile:
target: local
vm:
box: puphpet/ubuntu1404-x64
box_url: puphpet/ubuntu1404-x64
hostname: vagrant.dev
memory: '768'
cpus: '1'
chosen_provider: virtualbox
network:
@printminion
printminion / getGitFeatureStatus.sh
Created October 29, 2015 12:15
Get feature status from Jira
#!/bin/bash
#not working
#put yout domain here
JIRA_DOMAIN='https://jira.exampe.co'
#put your jira cookie here
JIRA_AUTH_COOKIE='Cookie: B99Z-2ZSI-HP7B-YQ6D|4e3c46668f653877516e3588114ba8c010e2d4e2|lin'
while read feature