Skip to content

Instantly share code, notes, and snippets.

View deemoowoor's full-sized avatar
😄
happy

Andrei Sosnin deemoowoor

😄
happy
View GitHub Profile
@deemoowoor
deemoowoor / .gitlab-ci.yml
Created February 26, 2020 18:59
Google Cloud Functions deployment made easy
deploy function to gcloud:
image: google/cloud-sdk:latest
script:
- gcloud auth activate-service-account --key-file $GCLOUD_SERVICE_KEY_FILE
- gcloud functions deploy $GCLOUD_FUNCTION_NAME --runtime go113 --entry-point $GCLOUD_FUNCTION_ENTRY_POINT --trigger-http
@deemoowoor
deemoowoor / jwtRS256.sh
Last active February 26, 2020 19:01 — forked from ygotthilf/jwtRS256.sh
How to generate a JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
[void] [Reflection.Assembly]::LoadWithPartialName("System.Messaging")
[System.Messaging.MessageQueue]::GetPrivateQueuesByMachine("LOCALHOST") | % {".\" + $_.QueueName} | % {[System.Messaging.MessageQueue]::Delete($_); }
echo "All MSMQ queues deleted"
ANDREI SOSNIN
Experienced software developer
Python, C#/.NET, Javascript, microservices, full stack, DevOps
Focused on accomplishing challenging development goals under strict deadlines.
Analytical and resourceful problem-solver with disciplined approach and skill
in producing clean, robust code. Effective technical professional experienced
in entire software development lifecycle. Considered expert in Python and C#,
knowledgeable in Javascript and SQL.
@deemoowoor
deemoowoor / .gitconfig
Created December 9, 2013 09:41
.gitconfig snippet
[alias]
st = status -s
ci = commit -v
sglog = log --pretty=oneline --topo-order --graph --abbrev-commit --branches --remotes --decorate
glog = log --pretty=oneline --topo-order --graph --abbrev-commit --branches --remotes --decorate --stat
co = checkout
b = branch
unstage = reset HEAD --
last = log -1 HEAD
diffstage = diff --staged
@deemoowoor
deemoowoor / zope.securitypolicy-role-ownership-test.py
Created March 21, 2013 15:00
zope.security policy object-level permissions test. Testing if setting two principals as 'owners' of two objects won't get mixed up (i.e. alice having an 'owner' role on object A could access object B, which is marked by 'owner' role for bob)
from zope.interface import implementer
from zope.annotation.interfaces import IAttributeAnnotatable
from zope.securitypolicy import zopepolicy
from zope.securitypolicy import interfaces
import zope.security.management
from zope.configuration.xmlconfig import xmlconfig
from StringIO import StringIO
configurezcml = """
@deemoowoor
deemoowoor / twisted_epoll_patch.diff
Last active December 13, 2015 20:48
Twisted patch for debugging/hackpatching epoll file descriptor registration bugs
--- knot/eggs/Twisted-12.3.0-py2.7-linux-x86_64.egg/twisted/internet/epollreactor.py 2013-02-17 16:23:51.217634204 +0200
+++ oms/eggs/Twisted-12.3.0-py2.7-linux-x86_64.egg/twisted/internet/epollreactor.py 2013-02-17 18:54:26.784532622 +0200
@@ -237,8 +236,14 @@
# this method in this file.
if fd in other:
flags |= antievent
+ log.msg('mod %s s: %s\n '
+ '(%s)'
+ % (fd, len(selectables), xer), system='epoll')
self._poller.modify(fd, flags)
@deemoowoor
deemoowoor / hggit-heroku-patch.diff
Created July 3, 2012 08:07
hggit Heroku patch
--- git_handler.py Thu Jul 28 22:05:45 2011
+++ patched.git_handler.py Thu Jul 28 22:11:44 2011
@@ -1066,6 +1066,8 @@
port = None
host, path = hostpath.split(hostpath_seper, 1)
+ if (host.find('heroku') > 0):
+ path = path.rstrip('/')
if hostpath_seper == '/':
transportpath = '/' + path
@deemoowoor
deemoowoor / 7-segment-arduino-voltmeter.cpp
Created December 27, 2010 20:20
Using Arduino as an ad-hoc low-voltage voltmeter with 3 7-segment elements with a shift register
// This represents pins on the Arduino board. Modify these numbers to
const int CLK = 5, MRESET = 6, DATA = 2, DIGIT1 = 3, DIGIT2 = 4, DIGIT3 = 7;
// These were taken straight out of http://en.wikipedia.org/wiki/Seven-segment_display
// If you hook up your 7-segment display lead A to lead Q1 of the shift register
// (lead 3 in case of NXP 74HC164N) of the display and so on, then feeding these
// codes to the register will result in the corresponding number showing up on
// the display. For example, 0x5B will give you a "2".
int ledCodes[] = {
@deemoowoor
deemoowoor / barebones-arduino-flash-based-snapshot-trigger.c
Created September 18, 2010 17:24
Arduino test code to work with an LCD panel
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(9, 10, 8, 7, 6, 5);
short sensorPin = 0;
short ledPin = 13; // select the pin for the LED
short sensorValue = 0; // variable to store the value coming from the sensor
short maxValue = 0;