Skip to content

Instantly share code, notes, and snippets.

View somnathrakshit's full-sized avatar

Somnath Rakshit somnathrakshit

View GitHub Profile
@somnathrakshit
somnathrakshit / mastodon-docker-setup.md
Created December 26, 2022 06:54 — forked from melroy89/mastodon-docker-setup.md
Mastodon Docker Setup - most complete and easiest guide online

Mastodon Docker Setup

In this guide we will only focus on using the prebuilt images from Docker Hub.

Prerequisites: You have Git, Docker and Docker compose installed.

Prepare

Clone Mastodon's repository.

captainVersion: 4
services:
$$cap_appname:
environment:
database__client: 'mysql'
database__connection__host: $$cap_mariadb_host
database__connection__database: $$cap_ghost_database_name
database__connection__password: $$cap_ghost_database_password
database__connection__user: $$cap_ghost_database_user
database__connection__port: '3306'
@somnathrakshit
somnathrakshit / heroku.sh
Created August 12, 2022 14:54 — forked from kogcyc/heroku.sh
how to install the heroku cli on raspberry pi
wget https://cli-assets.heroku.com/branches/stable/heroku-linux-arm.tar.gz
mkdir -p /usr/local/lib /usr/local/bin
sudo tar -xvzf heroku-linux-arm.tar.gz -C /usr/local/lib
sudo ln -s /usr/local/lib/heroku/bin/heroku /usr/local/bin/heroku
@somnathrakshit
somnathrakshit / gdrive_upload_folder.py
Created November 5, 2018 18:24 — forked from jmlrt/gdrive_upload_folder.py
Python script to upload folder to Google Drive
# -*- coding: utf-8 -*-
"""
Upload folder to Google Drive
"""
# Enable Python3 compatibility
from __future__ import (unicode_literals, absolute_import, print_function,
division)

Keybase proof

I hereby claim:

  • I am somnathrakshit on github.
  • I am somnath (https://keybase.io/somnath) on keybase.
  • I have a public key whose fingerprint is 9E7B 9FE7 555F E260 D57E 8EC2 8322 27CB 04A2 94F9

To claim this, I am signing this object:

@somnathrakshit
somnathrakshit / admin.py
Created August 20, 2017 18:21 — forked from armonge/admin.py
Show an image in django admin list_display, using sorl-thumbnail
class ProductAdmin(admin.ModelAdmin):
list_display = ('name','thumb')
def thumb(self, obj):
return render_to_string('thumb.html',{
'image': obj.image
})
thumb.allow_tags = True
@somnathrakshit
somnathrakshit / basics.R
Created September 2, 2016 11:51 — forked from anonymous/basics.R
R Code: Analytics Boot Camp
# R is a scripting language
# Arithmetic Operators
5+5
# 10
# Arithmetic Operators
# Addition: +
# Subtraction: -
@somnathrakshit
somnathrakshit / nQueen.py
Created August 4, 2016 04:58
n-Queens Problem
BOARD_SIZE = 4
def under_attack(col, queens):
left = right = col
for r, c in reversed(queens):
left, right = left-1, right+1
if c in (left, col, right):
return True
return False
@somnathrakshit
somnathrakshit / RatInAMaze.py
Last active August 4, 2016 05:13
Rat in a Maze
#!/usr/bin/env python3
'''This code should actually work with any ASCII maze that contains spaces for open paths, and a S, and E for
start and ending points. characters representing borders are redundant.
Create a text file containing the maze and type the name of the file as input
while running this code.
'''
'''
Main method in which the program starts
@somnathrakshit
somnathrakshit / mColoring.java
Created August 4, 2016 04:39
m Coloring Problem
/* Java program for solution of M Coloring problem
using backtracking */
public class mColoringProblem {
final int V = 4;
int color[];
/* A utility function to check if the current
color assignment is safe for vertex v */
boolean isSafe(int v, int graph[][], int color[],
int c)