Skip to content

Instantly share code, notes, and snippets.

@danixland
danixland / wp_manager.sh
Last active January 1, 2021 11:12
A small script to manage multiple local WordPress install. This script can install a new WordPress website checking out the latest revision from trunk on the official svn server, it will also install the plugins "theme-check" and "wordpress-importer" both downloaded from svn too. The script has a function that will keep updated from svn both the…
#! /bin/bash
#### SCRIPT OPTIONS ####
# the docroot for your webserver
WEBSERVER="/home/www/htdocs"
# hidden directory inside the docroot (if you want to use another directory outside of the docroot you have to change the whole script)
BASEDIR=".base"
# where the temp files has to be stored?
TMPDIR="/tmp/wp_manager"
# if you know WordPress this is self explanatory ;)
@danixland
danixland / pspvm.sh
Created March 25, 2013 16:48
psp video maker, a shell script that converts videos for the psp using ffmpeg.
#! /bin/bash
##### EXIT STATUS #####
E_INTERROR=71
E_NOINPUTVIDEOT=72
E_ALREADYTHM=73
E_NOSEC=74
E_NOINPUTVIDEOV=75
@danixland
danixland / wallpaper.sh
Created March 25, 2013 17:02
the name says it all, this little script will change the background of your desktop every 10 minutes. you just have to change the WPAPERS variable to match an existing directory full of jpg or png images. you'll have to have fbsetbg installed for this script to work..
#!/bin/bash
WPAPERS="/home/danix/Immagini/natura"
while true; do
find $WPAPERS -type f \( -name '*.jpg' -o -name '*.png' \) -print0 |
shuf -n1 -z | xargs -0 fbsetbg -f
sleep 10m
done
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`
Java -> `ace/mode/java`
Scala- -> `ace/mode/scala`
@danixland
danixland / .screenrc
Created May 26, 2013 11:56
my actual .screenrc
# no annoying audible bell, please
vbell on
# detach on hangup
autodetach on
# don't display the copyright page
startup_message off
# emulate .logout message
@danixland
danixland / googl.html
Last active October 3, 2017 18:00
goo.gl bookmarklet - this bookmarklet will return the shortened url of the current page
<a href="javascript:var%20uri=window.location.href;xhr=new%20XMLHttpRequest();xhr.open('POST','https://www.googleapis.com/urlshortener/v1/url',false);xhr.setRequestHeader('Content-Type','application/json');xhr.send(JSON.stringify({longUrl:uri}));var%20json=xhr.responseText;var%20obj=JSON.parse(json);alert(obj.id);">goo.gl this page</a>
@danixland
danixland / README.md
Last active December 18, 2015 07:39
A small script to batch add users to a WordPress website DO NOT USE IN PRODUCTION ENVIRONMENT!!!

usersbatch.php

script for batch adding users to a WordPress website.

DO NOT use in production environments.
This is just for testing purposes.

USE AT YOUR OWN RISK!
DO NOT BLAME ME IN CASE OF DAMAGES!!

@danixland
danixland / qrencoder.sh
Created June 18, 2013 09:43
qrencoder.sh - a little bash script that uses libqrencode by Fukuchi Kentaro to build a QR Code with your infos libqrencode - http://fukuchi.org/works/qrencode/ - https://github.com/fukuchi/libqrencode
#!/bin/bash
# qrencoder.sh - qrencoder.sh - a little bash script that uses libqrencode to build a QR Code with your infos
# libqrencode by Fukuchi Kentaro
# http://fukuchi.org/works/qrencode/ - official website
# https://github.com/fukuchi/libqrencode - development version on github
if [[ ! -z $1 ]];then
@danixland
danixland / snippet-kXMcOXR.sh
Last active January 24, 2016 21:32
just a snippet to remember how to remove extensions from filenames in bash
# we have a test file
FILE=test.avi
# and we want to output just its filename without the extension
echo ${FILE%.avi}
# this returns
# test
# ;)
// adds custom default gravatar for not logged in users
function sog_default_gravatar($avatar_defaults) {
$myavatar = get_bloginfo('stylesheet_directory') . '/images/mystery_danixland.jpg';
$avatar_defaults[$myavatar] = "danixland";
return $avatar_defaults;
}
add_filter( 'avatar_defaults', 'sog_default_gravatar' );