Skip to content

Instantly share code, notes, and snippets.

View tejastank's full-sized avatar

Tejas Tank tejastank

View GitHub Profile
@tejastank
tejastank / install-modoboa-opensuse.sh
Created October 14, 2021 06:50 — forked from jniltinho/install-modoboa-opensuse.sh
Install Modoboa Webmail Python on OpenSUSE 12.3
#!/bin/bash
## Install Modoboa Webmail Python on OpenSUSE 12.3
## Author: Nilton OS www.linuxpro.com.br
# Check if user has root privileges
if [[ $EUID -ne 0 ]]; then
echo "You must run the script as root or using sudo"
exit 1
fi
@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 / ubuntu.screenshot.txt
Created October 14, 2021 06:04
Ubuntu screenshot
print Take a Screenshot
Alt+Print Take a Screenshot of window
Shift+Print Take a Screenshot of an area
Ctrl+Print Copy a Screenshot to the clipboard
Ctrl+Alt+Print Copy a Screenshot of a window to the clipboard
@tejastank
tejastank / odoo-worker.sh
Created October 11, 2021 05:41
ODOO Performance Tune
#!/bin/bash
# CONST 1GB
CONST_1GB="1024*1024*1024"
# VARIABLE WORKERS
CMD_W=0
@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