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

Keybase proof

I hereby claim:

  • I am hslatman on github.
  • I am hslatman (https://keybase.io/hslatman) on keybase.
  • I have a public key whose fingerprint is 5728 776A 1F2C B634 52F9 E334 2BBD DDDD 3129 439A

To claim this, I am signing this object:

@hslatman
hslatman / archive.php
Last active March 16, 2019 11:06
Create .tar archive of all files in directory
<?php
/******************************************************************************************************************
* Source: http://www.emvee-solutions.com/blog/create-tar-files-archive-files-server-using-php-script/
*
* Please note that the script wil by default tar all files and (sub)folders from the directory you uploaded the script to
* into a file named archive.tar. You can overwrite the directory and archive name by calling the script with your own
* parameters, like this (replace the italic text for your own needs):
*
* http://domain.com/archive.php?targetname=achivename.tar&dir=relative/folder/to/put/in/archive/
******************************************************************************************************************/
@hslatman
hslatman / magento_clear_cache.php
Last active September 16, 2015 09:17
Clear Magento cache
<?php
/******************************************************************************************************************
* Source: http://www.emvee-solutions.com/blog/magento-clear-cache-programatically/
*
* Clearing the Magento cache programmatically
******************************************************************************************************************/
//increase execution time
ini_set('max_execution_time', 900); //900 seconds = 15 minutes
@hslatman
hslatman / magento_database_backup.php
Last active June 8, 2017 08:32
Create a Magento database backup
<?php
/******************************************************************************************************************
* Source: http://www.emvee-solutions.com/blog/magento-create-database-backup-php-code/
*
* Creating a Magento database backup in var/backups
******************************************************************************************************************/
//increase execution time
ini_set('max_execution_time', 900); //900 seconds = 15 minutes
@hslatman
hslatman / magento_custom_index.php
Last active November 1, 2019 11:55
Custom Magento re-indexing script
<?php
/******************************************************************************************************************
* Source: http://www.emvee-solutions.com/blog/magento-custom-reindex-script/
*
* Custom Magento re-indexing script
******************************************************************************************************************/
//Place this file in your Magento root folder, or modify the require once to match your directory.
@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 / RxNetworkLoader.swift
Created August 20, 2018 15:07
[Rx Network Loader] A network request performer with RxSwift
// Source: https://gist.github.com/dtartaglia/6ebec424bc57d47ed133e9306b74b55f
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 {