Skip to content

Instantly share code, notes, and snippets.

View atomAltera's full-sized avatar
🏠
Working from home

Konstantin Alikhanov atomAltera

🏠
Working from home
  • Nuclight
  • Tbilisi
View GitHub Profile
#!/bin/bash
cd $1
docker-compose stop nginx
docker-compose run --rm -p 443:443 nginx certbot renew --post-hook "mv /etc/letsencrypt/keys/0001_key-certbot.pem /etc/letsencrypt/keys/0000_key-certbot.pem"
docker-compose start nginx
0x7e4A82344200a504782e36E2b077CED92594ECAF
0xd9Ac5F5177AA6a075921b149D8aa26717267D241
@atomAltera
atomAltera / push_to.py
Created August 29, 2017 11:16
Testing APN
#!/usr/bin/env python
import binascii
import json
import socket
import ssl
import struct
import sys
def pack_payload(title, message, data=None, sound='Default', badge=1):
@atomAltera
atomAltera / google-calendar-fetch.py
Created December 14, 2016 06:41
Fetches holidays from Google calendar
from __future__ import print_function
import datetime
import json
import httplib2
from apiclient import discovery
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
@atomAltera
atomAltera / exif-sorter.py
Last active September 13, 2016 03:38
Python script for sorting pictures based on EXIF date
import glob
from datetime import datetime
from os import makedirs
from shutil import copy
import exifread
from path import path
def process_file(file_path, dest_dir):
@atomAltera
atomAltera / main
Created September 6, 2014 21:00
Loads from drive2.ru modles data
#!/usr/bin/env python3
import sys
from urllib.request import urlopen
import json
ERR_SUCCESS = 0
ERR_UNKNOWN = 1
ERR_MAKES_FILE_NOT_FOUND = 2
@atomAltera
atomAltera / file_type_search.js
Last active August 29, 2015 13:56
Node.js async text files search
var fs = require('fs');
var mime = require('mime');
function file_type_search(path, mime_match, callback_all, callback_each) {
var file_list = [];
var level = 0;
if (typeof callback_all !== 'function') callback_all = false;
if (typeof callback_each !== 'function') callback_each = false;
@atomAltera
atomAltera / angular-facebook.js
Last active August 29, 2015 13:56
Facebook JS SDK for AngularJS
angular.module('Nuclight.Services.Facebook', [])
.provider('facebook', function () {
var fb_options = {};
var fb_lang = 'en_US';
this.init = function (options, lang) {
fb_options = options;
if (lang) fb_lang = lang;
};
@atomAltera
atomAltera / T_ExecutorService.java
Created January 23, 2014 12:31
Simple Java example of using Executor Services
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.*;
public class T_ExecutorService {
public static void main(String[] args) throws InterruptedException {
ExecutorService ex = Executors.newFixedThreadPool(20);
System.out.printf("! Creating Executing service: %s%n", ex.getClass().getName());
System.out.println("! Submitting tasks");