Skip to content

Instantly share code, notes, and snippets.

Need to complie chroot for DSM (support for official has been stopped), then install pi hole for debian.
Docker won't work for 6.2 DSM dor DSM 214 SE as no support of kernel 3.2.40 by docker.
Install pi-hole without webadmin, as php5 is obsolete and no PPA exist for it.
Compiling chroot guide: https://github.com/OKit-Scripts-Projects/DSM.Customizations/blob/master/How.to.compile.spk.md#How.to.compile.spk
Kernel name is armada370-6.1 for armhl for DSM 214 SE
Using chroot to install pi-hole guide:
#!/bin/sh
# This script resizes the root partition of the phone, be careful.
set -xe
# needed for https://bugs.launchpad.net/ubuntu/+source/gparted/+bug/373409
echo "Resizing your root partition, this may take some time..."
echo "When done, it will REBOOT the device, make sure you're not losing any work!"
@parth-choudhary
parth-choudhary / script_to_import_rds.sh
Created July 18, 2018 17:34
script to import data in Amazon RDS for Postgresql
pg_restore --no-owner --role=<role> -d <db_name> <db_name.dump> -h <host_name> -U <user> -n public
@parth-choudhary
parth-choudhary / gist:06e510f529b1c81fbbed2a80d5446e98
Last active November 30, 2017 09:32
Download csv of all data in a HTML page inside a table
function downloadCSV(){
var csvContent = "data:text/csv;charset=utf-8,";
var table = $('.table').children().children();
var data = [];
for(i=0; i < table.length; i++)
{
var row = $(table[i]).children();
var temp = [];
for(j=0; j < row.length; j++){
temp[j] = $(row[j]).text();
@parth-choudhary
parth-choudhary / gist:b93518bb1f7d657a6bc3cc672dac5c0d
Created November 30, 2017 09:25
To pretty print time spent in javascript
function getTimeDiffAndPrettyText(oDatePublished) {
var oResult = {};
var oToday = new Date();
var nDiff = oToday.getTime() - oDatePublished.getTime();
// Get diff in days
oResult.days = Math.floor(nDiff / 1000 / 60 / 60 / 24);
@parth-choudhary
parth-choudhary / designer.html
Last active August 29, 2015 14:10
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;