Skip to content

Instantly share code, notes, and snippets.

View wheelq's full-sized avatar
🎯
Focusing

Michal Wiczynski wheelq

🎯
Focusing
View GitHub Profile
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@wheelq
wheelq / slack.sh
Created January 24, 2019 11:17 — forked from andkirby/slack.sh
Shell/Bash script for sending slack messages.
#!/usr/bin/env bash
####################################################################################
# Slack Bash console script for sending messages.
####################################################################################
# Installation
# $ curl -s https://gist.githubusercontent.com/andkirby/67a774513215d7ba06384186dd441d9e/raw --output /usr/bin/slack
# $ chmod +x /usr/bin/slack
####################################################################################
# USAGE
# Send message to slack channel/user
@wheelq
wheelq / slackpost
Created January 24, 2019 11:18 — forked from dopiaza/slackpost
Post a message to a Slack channel
#!/bin/bash
# Usage: slackpost <token> <channel> <message>
# Enter the name of your slack host here - the thing that appears in your URL:
# https://slackhost.slack.com/
slackhost=PUT_YOUR_HOST_HERE
token=$1
@wheelq
wheelq / python-venv-prepare.sh
Created February 19, 2019 09:43
Prepare and activate python (2.7/3.7) venv
#!/bin/bash
#python-venv-prepare.sh
_BASE_DIR="${PWD##*/}"
if [ $# -eq 0 ]; then
echo "Usage: ./python-venv-prepare.sh [2.7|3.7]"
exit 1
fi
@wheelq
wheelq / duplicati.docker-compose.yml
Last active February 19, 2019 09:46
vm/duplicati:1
---
#run: docker-compose up -f duplicati.docker-compose.yml -d
#run: docker-compose down --rmi local -f duplicati.docker-compose.yml -d
#to backup: ~/duplicati_config
#ports: 8200
version: "3"
services:
duplicati:
image: linuxserver/duplicati
@wheelq
wheelq / python-venv-clear.sh
Created February 19, 2019 09:49
Cleanup after python-venv-prepare.sh
#!/bin/bash
#python-venv-clear.sh
rm -rvf create-*.sh {dea,a}ctivate-*.sh init-*.sh *_venv-{2,3}*/
@wheelq
wheelq / duplicati.sh
Created February 19, 2019 09:53
Create or destroy duplicati in docker using docker-compose
#!/bin/sh
#Author: Michal Wiczynski <wheelq@gmail.com>
if [ $# -eq 0 ]; then
echo "Usage: ./duplicati.sh [start|stop]"
exit 1
fi
while [ $# -ne 0 ]
do
@wheelq
wheelq / osx_switch_off_coredumps
Created February 20, 2019 00:01
Switch off core dumps in OSX
sudo launchctl limit core 0 0
@wheelq
wheelq / ubuntu-docker-install.sh
Last active March 6, 2019 11:24
Docker install- Oneliner for Ubuntu
#!/bin/sh
#https://docs.docker.com/install/linux/docker-ce/ubuntu/
#Author: Michal Wiczynski <wheel.q@gmail.com>
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \