Skip to content

Instantly share code, notes, and snippets.

View artemnikitin's full-sized avatar
🍵

Artem Nikitin artemnikitin

🍵
View GitHub Profile
@artemnikitin
artemnikitin / gist:8952347
Last active August 29, 2015 13:56
Spock sample for Data Driven Testing
@Unroll("For currency #ccy and amount = #sum response will be #response_code - #response_text")
def "Check max and min sum for different currencies"() {
given: "Body for request with sum and currency"
String content = TestProperties.getRestBody(ccy, sum)
when: "Send request"
Response result = Request.send(RequestType.PUT, url, content);
then: "Check response"
result.status.contains(http)
@artemnikitin
artemnikitin / gist:d45a5746d68965545d03
Last active September 26, 2015 23:25
Generate Hmac SHA-1 signature via Java
import java.util.Base64;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
public class Hmac {
private static String data = "2.00|5101603|RUB|bill|test-checking-one-way-response-from-processing|0|белый тест|paid|tel:+79167421378";
private static String key = "123456789";
public static void main(String[] args){
@artemnikitin
artemnikitin / gist:ee3f91516fb05468d226
Created July 7, 2014 12:18
Generate Hmac SHA-1 signature via Python 2.7
#!/usr/bin/env python
import base64
import hmac
import hashlib
string = raw_input("Enter string to encode: ")
key = raw_input("Enter key: ")
hash = hmac.new(key, string, hashlib.sha1).digest()
@artemnikitin
artemnikitin / gist:4f2b15fc90479777ba87
Last active August 29, 2015 14:05
Issue bill via Qiwi REST API
#!/usr/bin/env python
import httplib
import argparse
import datetime
import random
import string
def tomorrow():
@artemnikitin
artemnikitin / gist:25ef5f9e5a14bb7b68a1
Created August 13, 2014 11:44
Binary search implementation with Python
#!/usr/bin/env python
import sys
sys.setrecursionlimit(20000)
data = [1, 4, 5, 22, 34, 55]
def search(start, end, value):
pivot = start + (end - start) / 2
if data[pivot] == value:
@artemnikitin
artemnikitin / aws-devicefarm-upload.go
Last active February 24, 2016 14:40
Example of file upload to AWS Device Farm
func uploadFile(url string) int {
file, err := os.Open(*appPath)
if err != nil {
log.Fatal("Failed to get file for upload because of: ", err.Error())
}
client := &http.Client{}
request, err := http.NewRequest("PUT", url, file)
if err != nil {
log.Fatal("Failed to create HTTP request because of: ", err.Error())
}
@artemnikitin
artemnikitin / slack-bot.go
Last active August 19, 2016 08:15
Slack bot for repost messages
package main
import (
"flag"
"fmt"
"log"
"os"
"regexp"
"strings"
@artemnikitin
artemnikitin / example.json
Created March 2, 2017 22:00
vulners macos json
{
"os": "MacOS",
"version": "10.12.4",
"package": [
"com.apple.pkg.AppExceptions.14U2177"
]
}
{
"result": "ERROR",
@artemnikitin
artemnikitin / example.json
Created March 3, 2017 07:44
response with vulnerabilities
{
"result": "OK",
"data": {
"packages": {
"openssl 0.9x-1+deb8u5 amd64": {
"DSA-3287": [
{
"package": "openssl 0.9x-1+deb8u5 amd64",
"providedVersion": "0.9x-1+deb8u5",
"bulletinVersion": "1.0.1e-2+deb7u17",
@artemnikitin
artemnikitin / IntelliJ_IDEA__Perf_Tuning.txt
Created April 16, 2017 11:40 — forked from P7h/IntelliJ_IDEA__Perf_Tuning.txt
Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
-server
-Xms2048m
-Xmx2048m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1