Skip to content

Instantly share code, notes, and snippets.

FROM collabora/code
ADD start.sh /
CMD bash start.sh
#!/bin/sh
# Fix lool resolv.conf problem (wizdude)
rm /opt/lool/systemplate/etc/resolv.conf
ln -s /etc/resolv.conf /opt/lool/systemplate/etc/resolv.conf
# Replace trusted host and set admin username and password
#perl -pi -e "s/localhost<\/host>/${domain}<\/host>/g" /etc/loolwsd/loolwsd.xml
#perl -pi -e "s/<username desc=\"The username of the admin console. Must be set.\"><\/username>/<username desc=\"The username of the admin console. Must be set.\">${username}<\/username>/" /etc/loolwsd/loolwsd.xml
#perl -pi -e "s/<password desc=\"The password of the admin console. Must be set.\"><\/password>/<password desc=\"The password of the admin console. Must be set.\">${password}<\/password>/g" /etc/loolwsd/loolwsd.xml
FROM collabora/code
ADD start.sh /
CMD bash start.sh
@pranavk
pranavk / puzzle
Created April 29, 2015 22:04
Puzzle game
/*
What is this game all about ?
There is an ideal 2D array consisting of alphabets from a to x, and the last element of the array being '-'. But the user is given some permutation of the array with '-' somewhere in between. The goal of the user is to reach that ideal 2D array.
*/
#include<stdio.h>
static char ideal[5][5] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
@pranavk
pranavk / analyse_ssh_usage.php
Created April 18, 2015 22:25
This analyses the data stored in mysql tables and show them in form of graph using HighCharts
<?php
$connect = mysql_connect("localhost", "username", "password");
if($connect) {
mysql_select_db("sshaccount");
$inputquery = "select UNIX_TIMESTAMP(time) as `time`, `out` from minute where user='username' order by time;";
$arr = mysql_query ($inputquery);
while ($row = mysql_fetch_array($arr)) {
$datetime = $row['time']*1000;
@pranavk
pranavk / gcd_euclid
Created January 13, 2015 18:52
Program to calculate GCD using Euclid algorithm
#include <stdio.h>
int gcd(int l,int s){
if(l%s==0){
return s;
}
int q=l/s;
int r=l%s;
gcd(s,r);