Skip to content

Instantly share code, notes, and snippets.

View vi7's full-sized avatar
💭
smd

Vitaliy D. vi7

💭
smd
  • Krakow, Poland
View GitHub Profile
@vi7
vi7 / i2c-dump.py
Created August 15, 2018 19:39 — forked from kost/i2c-dump.py
Script to dump I2C using pyBusPirateLite
#!/usr/bin/env python
# encoding: utf-8
"""
Adapted from i2c-test.py from Peter Huewe
"""
import sys
from pyBusPirateLite.I2C import *
import argparse
# initial before applicant available dates
curl 'https://appt.vfsglobal.com/Global-Appointment/Account/GetEarliestVisaSlotDate' -H 'Sec-Fetch-Mode: cors' -H 'DNT: 1' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8,pl;q=0.7' -H 'X-Requested-With: XMLHttpRequest' -H 'Cookie: _culture=en-US; ASP.NET_SessionId=rutwc5ybs2ywft2h3undje1e; _Role=Individual; .ASPXFORMSAUTH=F1AB79557138B5DCBEC20F4938F08536EB8D45E7AE4BC075C307AEC54F0AF2DF5B56AC6100949AE984903F0E603255668E1BBC01D4C0EF99C800626543EE378BC3D751B0093C537FCD9AE38A003D282B79BDD0333A4155A878764BFEB9AB85E5D449852669839A53F64641D33A156A7BC559E076B36C115928E2E6612A07208212A5BFD54E0BD98770BBB0872F6118A02DE11B9D1ADE26A3CFBB710CFC4A8456661AA19DC46F7DC5C0636BD0EAFE871922D3CA75AEB23FAB558AECF3082F969AAD2A2349B8496A86FA811A755C55EF4625FC05A33928A88A88ED5627BBE96942C810C898CACCB07BDD22A824B01476A299090A1DC750431C4463E93230F568741E7CC5C1BC91E08F6F2E5420456EBE1E5D694D6770E0BB4A29C088BCBB83845401E428E32EFC33D4569F2756FF5444580FD343D1A
27-Nov-2019 21:49:49.283 WARNING [Catalina-utility-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [ROOT]
registered the JDBC driver [com.mysql.cj.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the
JDBC Driver has been forcibly unregistered.
27-Nov-2019 21:49:49.299 WARNING [Catalina-utility-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROO
T] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak
. Stack trace of thread:
java.lang.Object.wait(Native Method)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:144)
com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:70)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
@vi7
vi7 / web.xml
Last active November 27, 2019 22:51
Tomcat app authz example: /usr/local/tomcat/webapps/ROOT/WEB-INF/web.xml
<!-- /usr/local/tomcat/webapps/ROOT/WEB-INF/web.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<!-- Authorization section starts here -->
<security-role>
<role-name>admin</role-name>
@vi7
vi7 / tomcat-users.xml.template
Last active November 28, 2019 22:19
Tomcat UserDatabaseRealm users file example
<?xml version="1.0" encoding="UTF-8"?>
<!-- /usr/local/tomcat/conf/tomcat-users.xml -->
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
<role rolename="admin"/>
<user username="RECIPEBOOK_USER" password="RECIPEBOOK_PASSWORD" roles="admin"/>
</tomcat-users>
@vi7
vi7 / kubectl.sh
Created January 9, 2020 12:45
kubectl cheat sheet
# Get all Evicted Pods (for the namespace 'default')
kubectl get po -ojsonpath="{.items[?(@.status.reason=='Evicted')].metadata.name}"
@vi7
vi7 / asus_router_nvram_top.sh
Created August 31, 2020 20:30
Show Asus router NVRAM top usage
#/usr/bin/env sh
# Try this one-liner to print the top 20 nvram variables by size (courtesy of ryzhov-al :) )
nvram show | awk '{print length(), $0 | "sort -n -r"}' | cut -d"=" -f 1 | head -n 20
@vi7
vi7 / Vagrantfile.winxp
Created October 12, 2020 06:14
Vagrantfile with Windows XP for the Need For Speed: Hot Pursuit 2 - Virtualbox 6.0.4
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "dvgamerr/win-xp-sp3"
config.vm.network "public_network"
@vi7
vi7 / Makefile
Created December 14, 2020 20:08 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@vi7
vi7 / krakow_corpo_careers.md
Last active December 17, 2020 13:28
Careers websites for the Krakow/Poland based corporations