Skip to content

Instantly share code, notes, and snippets.

View hslatman's full-sized avatar
💭
Gitting around

Herman Slatman hslatman

💭
Gitting around
View GitHub Profile
@hslatman
hslatman / magento-testing-scenarios.md
Last active November 3, 2018 04:56 — forked from peterjaap/magento-testing-scenarios.md
Magento testing scenarios

Magento testing scenarios

For use after an upgrade to verify the correct working of Magento

SHIP IT

Frontend

General

  • Activate all logs on the server (PHP, MySQL, Magento, mail, etc)
  • Check meta tags in HTML
#!/bin/bash
# This little hack-job will grab credentials from a running openvpn process in Linux
# Keep in mind this won't work if the user used the --auth-nocache flag
grep rw-p /proc/$1/maps | sed -n 's/^\([0-9a-f]*\)-\([0-9a-f]*\) .*$/\1 \2/p' | while read start stop; do gdb --batch-silent --silent --pid $1 -ex "dump memory $1-$start-$stop.dump 0x$start 0x$stop"; done
echo "Your credentials should be listed below as username/password"
strings *.dump | grep -B2 KnOQ | grep -v KnOQ
rm *.dump --force
@hslatman
hslatman / gist:77d935027dd7573d3483
Created December 29, 2015 09:41 — forked from atcuno/gist:3425484ac5cce5298932
HowTo: Privacy & Security Conscious Browsing

The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.

Table of Contents

exec > /tmp/${PROJECT_NAME}_archive.log 2>&1
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"
@hslatman
hslatman / Decodable+Random.swift
Created October 6, 2018 15:57 — forked from IanKeen/Decodable+Random.swift
Custom Decoder that can be used to create Decodable instances that are populated with random values
public extension Decodable {
static func randomInstance() throws -> Self {
let decoder = _RandomDecoder()
return try Self(from: decoder)
}
}
public class RandomDecoder {
public func decode<T: Decodable>(_: T.Type) throws -> T {
let decoder = _RandomDecoder()
@hslatman
hslatman / RX Generic Network Loader.swift
Created October 16, 2018 21:53
A generic loader for any sort of data. Just fill out the inputs.
struct LoadInput<T, U> {
let trigger: Observable<T> /// will cause the network request to start passing the T to the request generator.
let makeRequest: (T) -> URLRequest /// a function that knows how to create the URLRequest
let download: (URLRequest) -> Observable<Data> /// the function that actually does the download. By default, it uses URLSession.shared
let makeObject: (Data) -> U /// a function that knows how to convert the data into the needed resource.
}
extension LoadInput {
init(trigger: Observable<T>, makeRequest: @escaping (T) -> URLRequest, makeObject: @escaping (Data) -> U) {
self.trigger = trigger
@hslatman
hslatman / hello.h
Created October 18, 2018 11:02 — forked from ddrccw/hello.h
detect jailbreak
//
// Created by ddrccw on 14-1-10.
// Copyright (c) 2014年 ddrccw. All rights reserved.
// refer to http://danqingdani.blog.163.com/blog/static/1860941952012102122847478/
#import <sys/stat.h>
#import <mach-o/dyld.h>
//#import <stdlib.h>
//#import <string.h>
@hslatman
hslatman / Bindings.swift
Created October 18, 2018 11:25 — forked from stinger/Bindings.swift
KVO-driven model bindings
extension NSObjectProtocol where Self: NSObject {
func observe<Value>(_ keyPath: KeyPath<Self, Value>, onChange: @escaping (Value) -> ()) -> NSKeyValueObservation {
return observe(keyPath, options: [.initial, .new]) { _, change in
// TODO: change.newValue should never be `nil`, but when observing an optional property that's set to `nil`, then change.newValue is `nil` instead of `Optional(nil)`. This is the bug report for this: https://bugs.swift.org/browse/SR-6066
guard let newValue = change.newValue else { return }
onChange(newValue)
}
}
func bind<Value, Target>(_ sourceKeyPath: KeyPath<Self, Value>, to target: Target, at targetKeyPath: ReferenceWritableKeyPath<Target, Value>) -> NSKeyValueObservation {

A number of tech news outlets, including WIRED, GigaOm, and MIT Technology Review, have recently started writing about Multipeer Connectivity ("one weird trick that the NSA hates"). Since the NSHipster article on the subject has been linked to in a lot of this coverage, I wanted to share some additional thoughts on the matter:

Multipeer Connectivity(http://nshipster.com/multipeer-connectivity/) represents a significant shift in the opposite direction of how we conventionally think about mobile applications. Nearly every app on your phone operates in a client-server model, with the device making requests to remote cloud services to send and receive messages, photos, and videos. The [

@hslatman
hslatman / fluent-filebeat-comparison.md
Created November 7, 2018 09:27 — forked from StevenACoffman/fluent-filebeat-comparison.md
Fluentd Fluent-bit FileBeat memory and cpu resources

Fluent-bit rocks

A short survey of log collection options and why you picked the wrong one. 😜

Who am I? Where am I from?

I'm Steve Coffman and I work at Ithaka. We do JStor (academic journals) and other stuff. How big is it?

Number what it means
101,332,633 unique visitors in 2017