Skip to content

Instantly share code, notes, and snippets.

View kasparsd's full-sized avatar

Kaspars Dambis kasparsd

View GitHub Profile
@kasparsd
kasparsd / pkcs15-tool-read-cert-auth.log
Last active November 25, 2015 14:13
Latvia ID pkcs15-tool read public key and cert
$ pkcs15-tool --read-certificate 56de1e2a32da45d3ce69c6078bffea646a947405 -vvvvv
0x7fff7565b000 16:12:54.4294967800 [pkcs15-tool] sc.c:195:sc_detect_card_presence: called
0x7fff7565b000 16:12:54.140733193388537 [pkcs15-tool] reader-pcsc.c:403:pcsc_detect_card_presence: called
0x7fff7565b000 16:12:54.505 [pkcs15-tool] reader-pcsc.c:284:refresh_attributes: OMNIKEY AG Smart Card Reader check
0x7fff7565b000 16:12:54.4294967802 [pkcs15-tool] reader-pcsc.c:340:refresh_attributes: current state: 0x00000022
0x7fff7565b000 16:12:54.4294967802 [pkcs15-tool] reader-pcsc.c:341:refresh_attributes: previous state: 0x00000122
0x7fff7565b000 16:12:54.4294967802 [pkcs15-tool] reader-pcsc.c:395:refresh_attributes: card present
0x7fff7565b000 16:12:54.140733193388538 [pkcs15-tool] reader-pcsc.c:408:pcsc_detect_card_presence: returning with: 1
0x7fff7565b000 16:12:54.140733193388538 [pkcs15-tool] sc.c:200:sc_detect_card_presence: returning with: 1
@kasparsd
kasparsd / token-init.log
Created November 25, 2015 14:19
EstEID Tokend with Latvia ID
2015-11-25 16:18:43.886 main() [esteid.cpp:21] main starting with 4 arguments
2015-11-25 16:18:43.899 EstEIDToken() [EstEIDToken.cpp:84] new EstEIDToken()
2015-11-25 16:18:43.899 probe() [EstEIDToken.cpp:95] _
2015-11-25 16:18:43.899 probe() [EstEIDToken.cpp:96] _ __ _ __ ___ | |__ ___
2015-11-25 16:18:43.900 probe() [EstEIDToken.cpp:97] | '_ \| '__/ _ \| '_ \ / _ \
2015-11-25 16:18:43.900 probe() [EstEIDToken.cpp:98] | |_) | | | (_) | |_) | __/
2015-11-25 16:18:43.900 probe() [EstEIDToken.cpp:99] | .__/|_| \___/|_.__/ \___|
2015-11-25 16:18:43.900 probe() [EstEIDToken.cpp:100] |_|
2015-11-25 16:18:43.900 probe() [EstEIDToken.cpp:108] current ATR: '3BDD18008131FE45904C41545649412D65494490008C'
2015-11-25 16:18:43.901 _connectAndBeginTransaction() [EstEIDToken.cpp:672] Connecting using reader: OMNIKEY AG Smart Card Reader - current state: 0x10, event state: 0x7FFF00000022

Keybase proof

I hereby claim:

  • I am kasparsd on github.
  • I am kaspars (https://keybase.io/kaspars) on keybase.
  • I have a public key whose fingerprint is A134 BA02 60D4 3F8E ACC8 89D9 94F1 3532 A319 EA5D

To claim this, I am signing this object:

@kasparsd
kasparsd / normalize-path.php
Created December 15, 2015 18:02
Normalize relative path to absolute path
<?php
function normalize_url( $url ) {
$delete = 0;
$index = 0;
$parts = explode( '/', $url );
foreach ( $parts as $p => $part ) {
if ( '..' === $part ) {
$delete++;
@kasparsd
kasparsd / enable-post-type-aps.php
Last active December 15, 2015 19:19
Enable post_type support for Automatic Post Scheduler plugin
<?php
// Called from $time_of_post = aps_get_nearest_open_time( $data );
function aps_get_nearest_open_time( $data ) {
// get furthest scheduled post
$post = get_posts( array(
'numberposts' => 1,
'post_status' => 'future',
'post_type' => $data['post_type']
@kasparsd
kasparsd / logitech-c270-lsusb-webcam
Created June 16, 2013 20:46
Logitech, Inc. Webcam C270, output of `lsusb -v`
Bus 001 Device 004: ID 046d:0825 Logitech, Inc. Webcam C270
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2 ?
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 64
idVendor 0x046d Logitech, Inc.
@kasparsd
kasparsd / gobots.sh
Created June 28, 2013 08:14
Create a GoAccess report of bots crawling your sites
#!/bin/sh
# Note: You need to run this as a user who has access to those log files
cat /var/log/nginx/access.log* | grep bot | goaccess -a
# Examples
#
# 1) Send output to logs.html
@kasparsd
kasparsd / drdrang.opml
Created December 20, 2015 21:42
Dr. Drang Feed List
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Feeds from Dr. Drang</title>
<dateCreated>Sun, 20 Dec 2015 21:40:06 GMT</dateCreated>
</head>
<body>
<outline type="category" text="Dr. Drang Feeds">
<outline type="rss" text="" xmlUrl="http://feedpress.me/512pixels" htmlUrl="" />
<outline type="rss" text="" xmlUrl="http://www.leancrew.com/all-this/feed/" htmlUrl="" />
@kasparsd
kasparsd / wp-config.php
Created December 21, 2015 09:38
FORCE_SSL_ADMIN for certain domains on WordPress Multisite
<?php
$ssl_domains = array(
'example.com',
'anotherexample.com',
);
if ( in_array( $_SERVER['SERVER_NAME'], $ssl_domains ) ) {
define( 'FORCE_SSL_ADMIN', true );
}
@kasparsd
kasparsd / mobius-camera-usb-info.txt
Created August 21, 2013 12:03
USB device info of Mobius Action Camera (firmware 0.42)
High Speed device @ 4 (0xFD120000): ............................................. Miscellaneous/Common Class device: "Mobius\000"
Port Information: 0x1018
Not Captive
External Device
Connected
Enabled
Number Of Endpoints (includes EP0):
Total Endpoints for Configuration 1 (current): 3
Device Descriptor
Descriptor Version Number: 0x0200