Skip to content

Instantly share code, notes, and snippets.

View tejastank's full-sized avatar

Tejas Tank tejastank

View GitHub Profile
@tejastank
tejastank / 1. server_install.md
Created October 14, 2021 06:50
Ubuntu server installation

Rename the server

  • Edit file /etc/hostname
  • Edit file /etc/hosts and replace hostname following the address "127.0.1.1"
  • Reboot with sudo reboot

Create new user

  • Create a new user with adduser username
  • Add the user to the sudo group with usermod -aG sudo username
  • Put a random string as root password to avoid log in with root user with passwd (https://passwordsgenerator.net/)
#!/bin/bash
# set -x
# Program information
name="hashIdZimbra F.A.Z"
version="1.0.1"
releasedate="11 May 2016"
author="by Richardson Lima"
author_contact="contato@richardsonlima.com.br"
website="http://www.richardsonlima.com.br"
@tejastank
tejastank / zimbra-letsencrypt.sh
Created October 14, 2021 06:38 — forked from bouroo/zimbra-letsencrypt.sh
Install Zimbra Collaboration on ubuntu LTS
#!/usr/bin/env bash
MAIL_DOMAIN="your.mail.domain"
# Run once
# Download Java Cryptography Extension (JCE) from http://www.oracle.com/technetwork/java/javase/downloads/index.html
# and extract .jar replace in /opt/zimbra/common/lib/jvm/java/jre/lib/security
# Use strong cipher for nginx
#su - zimbra -c "zmprov mcf zimbraReverseProxySSLCiphers 'ECDHE+CHACHA20:ECDHE+AESGCM:DHE+AESGCM:ECDHE+AES:DHE+AES:RSA+AESGCM:RSA+AES:!DES-CBC3-SHA:!DSS'"
#su - zimbra -c 'zmprov mcf +zimbraResponseHeader "Strict-Transport-Security: max-age=31536000"'
#su - zimbra -c "zmdhparam set -new 4096"
# Disable weak ciphers
@tejastank
tejastank / webview.js
Created August 19, 2021 15:53 — forked from sdiama/webview.js
React Native: Handle hardware back button @ webview
import React, { Component } from 'react';
import { WebView, BackHandler } from 'react-native';
export default class WebViewMoviezSpace extends Component {
constructor(props) {
super(props);
this.WEBVIEW_REF = React.createRef();
}
componentDidMount() {
@tejastank
tejastank / default.vcl_PREFACE.md
Created August 6, 2021 05:20 — forked from fevangelou/default.vcl_PREFACE.md
The perfect Varnish configuration for Joomla, WordPress & other CMS based websites

The perfect Varnish configuration for Joomla, WordPress & other CMS based websites

IMPORTANT: Read this before implementing one of the configuration files below (for either Varnish 3.x or 4.x+).

USE: Replace the contents of the main Varnish configuration file located in /etc/varnish/default.vcl (root server access required - obviously) with the contents of the configuration you'll use (depending on your Varnish version) from the 2 examples provided below.

IMPORTANT: The following setup assumes a 180 sec (3 minute) cache time for cacheable content that does not have the correct cache-control HTTP headers. You can safely increase this to 300 sec (or more) for less busier sites or drop it to 60 sec or even 30 sec for high traffic sites.

This configuration requires an HTTP Header and a user cookie to identify if a user is logged in a site, in order to bypass caching overall (see how it's done for Joomla & WordPress). If your CMS provides a way to add these two requirements, then you can use this configurati

import requests
import json
URL_BASE = 'https://rest.developer.yodlee.com/services/srest/restserver/v1.0'
# assumes you've signed up for dev access, and already done the one-time linking of bank accounts
# to user accounts via the Yodlee website
# cobrand login
payload = { 'cobrandLogin': 'sbCob<account>', 'cobrandPassword': '<something>' }

Before you start

Make sure you have python, OpenFace and dlib installed. You can either install them manually or use a preconfigured docker image that has everying already installed:

docker pull bamos/openface
docker run -p 9000:9000 -p 8000:8000 -t -i bamos/openface /bin/bash
cd /root/openface
import cv2
# variables
# distance from camera to object(face) measured
Known_distance = 30 #centimeter
# width of face in the real world or Object Plane
Known_width =14.3
# Colors
GREEN = (0,255,0)
RED = (0,0,255)
WHITE = (255,255,255)
@tejastank
tejastank / azure_load.py
Created March 31, 2021 06:40 — forked from bigsnarfdude/azure_load.py
azure_load.py
import os
from os import listdir
from os.path import isfile, join
import asyncio
from azure.storage.blob import BlobServiceClient
from azure.storage.blob.aio import BlobClient
from azure.storage.blob.aio import ContainerClient
from datetime import datetime, timedelta
@tejastank
tejastank / ccn_chop_chop.py
Created March 31, 2021 06:40 — forked from bigsnarfdude/ccn_chop_chop.py
crop faces from pictures face_recognition lib and PIL
import os
import numpy as np
import cv2
import mrcnn.config
import mrcnn.utils
from mrcnn.model import MaskRCNN
from pathlib import Path
# Configuration that will be used by the Mask-RCNN library