Skip to content

Instantly share code, notes, and snippets.

Pranav Kant pranavk

Block or report user

Report or block pranavk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Dockerfile
FROM collabora/code
ADD start.sh /
CMD bash start.sh
View gist:3014847db661cd671e0b579ac4a9de30
#!/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
@pranavk
pranavk / puzzle
Created Apr 29, 2015
Puzzle game
View puzzle
/*
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 Apr 18, 2015
This analyses the data stored in mysql tables and show them in form of graph using HighCharts
View analyse_ssh_usage.php
<?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 Jan 13, 2015
Program to calculate GCD using Euclid algorithm
View gcd_euclid
#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);
You can’t perform that action at this time.