Skip to content

Instantly share code, notes, and snippets.

@JosephKiranBabu
JosephKiranBabu / import-into-mediawiki.py
Last active September 24, 2018 18:58
A badly written script to import Dokuwiki files into MediaWiki
#!/usr/bin/python3
import os
from urllib.parse import unquote
MEDIAWIKI_DIR = '/var/lib/mediawiki/'
# Files are assumed to be in a dir called mod
# in the same directory as the script
[(_, _, file_names)] = os.walk('mod')
  • AWStats - Generates web, streaming, ftp or mail server statistics graphically. (Source Code) GPLv3 Perl
  • GoAccess - Real-time web log analyzer and interactive viewer that runs in a terminal. (Source Code) GPLv2 C
  • FHEM - FHEM is used to automate common tasks in the household like switching lamps and heating. It can also be used to log events like temperature or power consumption. You can control it via web or smartphone frontends, telnet or TCP/IP directly. (Source Code) GPLv3 Perl
  • RSS-Bridge - rss-bridge is a PHP project capable of generating ATOM feeds for websites which don't have one. Public domain PHP
  • PluXml - XML-based blog/CMS platform. (Source Code) GPL PHP
  • [WordPress](https://wordpress.or
@JosephKiranBabu
JosephKiranBabu / all-shortcuts.patch
Last active February 26, 2018 05:39
Changes to add all shortcuts to Plinth home page
diff --git a/plinth/frontpage.py b/plinth/frontpage.py
index d50a8a7..786bbcf 100644
--- a/plinth/frontpage.py
+++ b/plinth/frontpage.py
@@ -22,8 +22,20 @@ Manage application shortcuts on front page.
shortcuts = {}
+def add_all_shortcuts():
+ from plinth import module_loader
@JosephKiranBabu
JosephKiranBabu / mastodon-deps.py
Created April 5, 2017 06:49
Script to analyze dependencies of Mastodon
import subprocess
import sys
lang = sys.argv[1]
def find_unmet_dependencies():
unmet_dependencies=[]
dependencies=[]
@JosephKiranBabu
JosephKiranBabu / language comparison
Last active February 11, 2017 04:09
Comparing sorting a list of employees by their salary in 4 languages.
Clojure
(def emps (map (fn [x] {:name (str "employee" x) :salary (* 100 x)}) (take 10 (range 1 10))))
(take (/ (count emps) 10) (reverse (sort-by :salary emps)))
Haskell
import Data.List (sortBy)
data Employee = Employee {name :: String, salary :: Double } deriving (Show)
@JosephKiranBabu
JosephKiranBabu / learning_scalaz.sc
Created September 27, 2016 06:20
Demonstration of Scalaz as a Scala utility library.
import scalaz._
import Scalaz._
val list = List(1,2,3,4)
//syntactic sugar
(1 == 2) ? 'a' | 'b'
1 == 2 option 'a'
1.some === none[Int] // typesafe option
'a' =/= 'b'
@JosephKiranBabu
JosephKiranBabu / about_scoring_project.py
Created January 19, 2016 01:07
My first python program.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
# Greed is a dice game where you roll up to five dice to accumulate
# points. The following "score" function will be used calculate the
# score of a single roll of the dice.
#
# A greed roll is scored as follows: