Skip to content

Instantly share code, notes, and snippets.

View andersevenrud's full-sized avatar
🤘
w^w^^w^w

Anders Evenrud andersevenrud

🤘
w^w^^w^w
View GitHub Profile
@andersevenrud
andersevenrud / setboardconfig.lua
Created January 29, 2016 18:44
setboardconfig.lua
local function get_board_config_command(info)
local a = {}
if info["wifi"] ~= nil then
table.insert(a, "-wifipassword \"" .. info["wifi"]["password"] .. "\"")
table.insert(a, "-wifiencryption \"" .. info["wifi"]["encryption"] .. "\"")
table.insert(a, "-wifibssid \"" .. info["wifi"]["bssid"] .. "\"")
end
if info["hostname"] ~= nil then
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<!-- YOUR MARKUP HERE -->
<div>
<button id="Test">Test</button>
</div>
(function(Application, GUI, Dialogs, Utils, API, VFS) {
'use strict';
/////////////////////////////////////////////////////////////////////////////
// APPLICATION
/////////////////////////////////////////////////////////////////////////////
function ApplicationFooBar(args, metadata) {
Application.apply(this, ['ApplicationFooBar', args, metadata, {
src: 'data/index.html',
@andersevenrud
andersevenrud / wordpress-hack.md
Created March 5, 2016 19:37
wordpress-hack.md

Wordpress is a very popular target for hackers. They normally get in with holes found in plugins, themes or in wordpress core.

Prevention methods

An up-to-date installation (including plugins and themes) is crutial!

Hardening Wordpress is sadly not a part of the standard installation documentation, but they have a guide available in the "codex": http://codex.wordpress.org/Hardening_WordPress

Removing unused plugins and users, setting htpasswd and/or ip-whitelisting in //wp-admin// also should be considered.

" Enable filetype plugin
filetype plugin on
filetype indent on
" Filetypes and encoding
set fileformats=unix,dos,mac
set encoding=utf-8
set wildignore=.svn,CVS,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif
" General behaviour
<application-window data-id="MyProjectWindow" data-width="600" data-allow_maximize="false" data-allow_minimize="false">
<gui-fragment data-fragment-id="TabsTheme" />
</application-window>
<application-fragment data-id="TabsTheme">
<gui-tabs>
<gui-tab-container data-id="TabTheme" data-label="Theme">
<gui-fragment data-fragment-id="TabThemeFragment"></gui-fragment>
1: Ex, create `src/conf/900-custom.json`
{
"server": {
"proxies": {
"/foo": "http://somewhere-else",
"(regexp)/^\\/bar/": "http://somewhere-elsewhere"
}
}
}
@andersevenrud
andersevenrud / osjs-find-used.icons.sh
Last active April 9, 2016 20:00
osjs-find-used.icons.sh
#!/bin/bash
#
# First, run "grunt"
#
# Then `./osjs-find-used.icons.sh | sort | uniq` to get a list of all icons used
#
GREPPED=$(grep -RHIi "\.png" dist/ | egrep -o '\w+\/[_A-Za-z0-9\-]+\.png')
for g in $GREPPED; do
if [ -f "src/client/themes/icons/default/16x16/${g}" ]; then
echo $g
@andersevenrud
andersevenrud / server.lua
Created May 17, 2016 16:16
OS.js Application API Lua boilerplate
#!/usr/bin/lua
--
-- This is a OS.js Application API example for Lua
--
local function request(m, a, request, response)
local result = false
-- error, result
@andersevenrud
andersevenrud / localstorage.js
Last active June 16, 2016 16:12
localstorage.js
/*!
* OS.js - JavaScript Cloud/Web Desktop Platform
*
* Copyright (c) 2011-2016, Anders Evenrud <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this