Skip to content

Instantly share code, notes, and snippets.

View resultakak's full-sized avatar
👨‍💻
Focusing

Resul Takak resultakak

👨‍💻
Focusing
View GitHub Profile
@resultakak
resultakak / php-docker-ext
Created July 19, 2021 20:02 — forked from hoandang/php-docker-ext
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
@resultakak
resultakak / nginxproxy.md
Created April 7, 2021 18:57 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@resultakak
resultakak / Dockerfile
Created April 7, 2021 12:05
Deploy a Node Js App to DigitalOcean Droplet with Docker
FROM node:13-alpine
WORKDIR /user/src/app
COPY package*.json ./
RUN npm install
COPY . .
@resultakak
resultakak / index.js
Created February 24, 2021 22:11
[deprecated] Get list of users in a Telegram channel (supergroup)
/*
* MIT License
*
* Copyright (c) 2017-2018 Bannerets <[email protected]>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@resultakak
resultakak / steps.md
Created February 23, 2021 20:46 — forked from alexander-young/steps.md
Install Redis for WordPress

Installing Redis

  • sudo apt update
  • sudo apt install redis-server
  • sudo nano /etc/redis/redis.conf
  • supervised systemd
  • maxmemory 128M
  • maxmemory-policy allkeys-lfu
  • sudo systemctl restart redis.service
  • sudo systemctl status redis
  • redis-cli and ping
@resultakak
resultakak / Dockerfile
Created February 23, 2021 19:24 — forked from PatrickKalkman/Dockerfile
Add non root user to docker file
FROM python:3.8.7-alpine
RUN pip install --upgrade pip
RUN pip install pipenv
RUN adduser -D python
# Create the work dir and set permissions as WORKDIR set the permissions as root
RUN mkdir /home/python/app/ && chown -R python:python /home/python/app
WORKDIR /home/python/app
@resultakak
resultakak / standalone.md
Created February 17, 2021 22:05 — forked from NekR/standalone.md
How to detect if app was run in standalone mode in Chromium (with manifest.json)

Hacky way to detect if app was launched in standalone mode in Chromium (with manifest.json) without problems with AppCache (and possibly ServiceWorker).

As suggested on one of the Google Developers sites, one may use search params in start_url of the manifest.json to notify page about that it was launched in standalone mode: start_url: '/?standalone'.

This works well unless your page uses AppCache (or ServiceWorker). In case of AppCache, every url with different search params is treated as separate entry in cache. So if you have listed / path in AppCache and naively used start_url: '/?standalone' in your manifest.json, then your Web App won't work offline from the Home Screen.
_With ServiceWorker, however, there is few ways to fix this directly in its code, like ignoreSearch option for match() method (currently not supported in Chromium) or just traversing cache entries manually and comparing new URL(event.request.url).pathname with stored request `new URL(...).path

@resultakak
resultakak / Dockerfile
Created October 5, 2020 12:22
hsyndockr
FROM node:10-alpine
LABEL author="Resul Takak"
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
WORKDIR /home/node/app
COPY package*.json ./
@resultakak
resultakak / deploy-mern.md
Created September 29, 2020 21:01 — forked from rmiyazaki6499/deploy-mern.md
Deploying a Production ready React-Express app on AWS EC2 with CI/CD

Deploying a Production ready React-Express app on AWS

In this tutorial, I will be going over to how to deploy a Javascript app from start to finish using AWS and EC2. Recently, my partner Tu and I launched our app AlgoAcademy (a resource for reviewing algorithms and data structures) and we wanted to share with other developers some of the lessons we learned along the way.

Following this tutorial, you will have an application that has:

  • A React frontend, Express backend
  • An AWS EC2 server configured to host your application
  • SSL-certification with Certbot
  • A custom domain name
@resultakak
resultakak / remote_bash.sh
Created September 12, 2020 17:39 — forked from n0ts/remote_bash.sh
execute bash script from remote site
# http://stackoverflow.com/questions/5735666/execute-bash-script-from-url
bash <(curl -s http://mywebsite.com/myscript.txt)
# http://stackoverflow.com/questions/4642915/passing-parameters-to-bash-when-executing-a-script-fetched-by-curl
curl http://foo.com/script.sh | bash -s arg1 arg2