Skip to content

Instantly share code, notes, and snippets.

View vdvm's full-sized avatar

Attila van der Velde vdvm

View GitHub Profile
@vdvm
vdvm / gist:4665450
Last active December 13, 2023 23:29
Recursive array str_replace
<?php
function recursive_array_replace($find, $replace, $array) {
if (!is_array($array)) {
return str_replace($find, $replace, $array);
}
$newArray = array();
<?php
return array(
'includes' => array('_aws'),
'services' => array(
'default_settings' => array(
'params' => array(
'key' => 'KEY',
'secret' => 'SECRET',
'base_url' => 'http://o.auroraobjects.eu'
@vdvm
vdvm / srt2vtt.sh
Created April 15, 2014 14:31
Convert .srt to .vtt
#!/bin/bash
echo "WEBVTT"
echo ""
sed '/[0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9][0-9][0-9] --> [0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9][0-9][0-9]/s/,/./g' $1
@vdvm
vdvm / auroraobjects-laravel.md
Created April 22, 2014 13:04
Using AuroraObjects with Laravel 4
https://github.com/aws/aws-sdk-php-laravel
https://github.com/aws/aws-sdk-php

composer.json:

{
 "require": {
@vdvm
vdvm / sublime-settings.json
Created May 1, 2014 14:00
Sublime settings
{
"translate_tabs_to_spaces": true,
"indent_to_bracket": true,
"highlight_line": true,
"trim_trailing_white_space_on_save": true,
"ensure_newline_at_eof_on_save": true
}
@vdvm
vdvm / httpserver.go
Created June 30, 2014 08:34
Simple HTTP server in Go
package main
import (
"log"
"net/http"
"os"
)
func main() {
cwd, _ := os.Getwd()
@vdvm
vdvm / unattended-mysql_secure_installation.md
Created December 23, 2014 14:50
A way to run mysql_secure_installation unattended

anwsers.txt:



mysecret
mysecret


n
@vdvm
vdvm / mysql_secure_installation.md
Created December 23, 2014 15:01
mysql_secure_installation queries

Set root password:

UPDATE mysql.user SET Password=PASSWORD('mysecret') WHERE User='root';
FLUSH PRIVILEGES;

Remove anonymous users:

Keybase proof

I hereby claim:

  • I am vdvm on github.
  • I am vdvm (https://keybase.io/vdvm) on keybase.
  • I have a public key whose fingerprint is 6B4F 9ACB A175 F1F3 12CF 9817 D4F5 10F1 A8EA B676

To claim this, I am signing this object:

@vdvm
vdvm / wifi.mobileconfig
Created January 16, 2015 11:04
Apple configuratieprofiel: wifi.mobileconfig
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Inc//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadVersion</key>
<integer>1</integer>
<key>PayloadUUID</key>
<string>{{ UUID_1 }}</string>
<key>PayloadType</key>
<string>Configuration</string>