Skip to content

Instantly share code, notes, and snippets.

@reshadman
reshadman / sentry-install-ubuntu-20.sh
Created December 12, 2020 20:52 — forked from midweste/sentry-install-ubuntu-20.sh
Install sentry on Ubuntu 20 with Snap
#!/bin/sh
# need to have at least 2.5GB of memory of this install may fail - see docs
# todo 13:52:28 [WARNING] sentry.utils.geo: settings.GEOIP_PATH_MMDB not configured.
SENTRYDB='sentry'
SENTRYUSER='sentry'
SENTRYPW='sentrypw'
# sudo apt-get install -y postgresql postgresql-contrib redis
sudo apt-get install -y postgresql redis

Thing you should consider before the beginning:

  • Use a linux based distro as your daily O.S preferrably Ubuntu if you don't know what Ubuntu is search for it.
  • Install Ubuntu you would never come back to Windows :D
  • Then put effort on learning O.S package managers like apt for Ubuntu, yum for CentOS etc.
  • Learn to work with terminal, learn how bash scripts work but don't put too much effort on them just as enough as you know how they work
  • Download PHPStorm (Acts like Visual Studio but it is for PHP World)
  • Learn to work with one additional Editor such as Sublime Text or "Visual Studio Code -- it is different from Visual Studio--"

Start learning PHP / Javascript / CSS / MySQL

<div id="jobinjaEmbedded--1526362404115">
<script type="text/javascript">
window.jobinjaEmbedded = window.jobinjaEmbedded || {q: []};
window.jobinjaEmbedded.q.push({
"slug": "zarinpal",
"containerId": "jobinjaEmbedded--1526362404115",
"baseUrl": "https://jobinja.ir",
"linkColor": "#303030",
"linkHoverColor": "#d5aa1f",
"cta": false,
<script type="text/javascript">
window.jobinjaEmbedded = window.jobinjaEmbedded || {q: []};
window.jobinjaEmbedded.q.push({
"slug": "benis-flower-1",
"containerId": "jobinjaEmbedded--1526362404115",
"baseUrl": "https://jobinja.ir",
"linkColor": "#EC1D3D",
"linkHoverColor": "#b71730",
"cta": true,
"header": true,
@reshadman
reshadman / letsencrypt_2017.md
Created April 21, 2018 18:56 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

<template>
<div>
<table class="ui striped celled table">
<thead>
<tr>
<th>نام پکیج</th>
<th class="right aligned">تاریخ ایجاد</th>
<th class="center aligned">وضعیت</th>
<th>فعال در قسمت</th>
<th class="right aligned">عملیات</th>
<?php
class UserController {
public function postCreate(UserCreatorService $userCreatorService, Request $request)
{
$creationNeeds = new CreationValueObject;
$creationNeeds->username = $request->username;
$creationNeeds->password = $request->password;
$creationNeeds->email = $request->email;
<?php
require_once 'recipe/common.php';
// A deploy script for for deployer.org used at Jobinja.ir
// The script creates a folder for each one of your releases
// and makes them zero downtime deploys, this is tuned for laravel
// but the logic can be used for anything which needed transactional folder
// based changes.
// As some of the npm packages are banned in our server ISP we use
// a combination of shadowsocks and polipo(for reversing https and socks)
@reshadman
reshadman / action.js
Last active November 1, 2015 11:57
Processing Laravel jobs from node.
'use strict';
var redis = require('redis');
var LaravelJob = require('./index');
// Create laravel job instance
var job = new LaravelJob({});
// Set handlers on the job
job.registerHandler("Jobinja\\Jobs\\ExampleJob", function(job, payload) {
console.log(payload);
@reshadman
reshadman / Loop.java
Created May 3, 2015 17:15
Simple loop in programming languages -- for permance benchmarking of a WHILE LOOP --
public class Loop {
public static void main(String[] args)
{
Integer total = 500000000;
Integer chunk = 50000000;
Integer i = 0;