Skip to content

Instantly share code, notes, and snippets.

View tguduk42's full-sized avatar
🏠
Working from home

Turgut Güdük tguduk42

🏠
Working from home
View GitHub Profile
@masasdani
masasdani / letsencrypt-nginx-centos.md
Last active May 26, 2021 13:00
letsencyript SSL nginx proxy centos 7

Install Letsencrypt Nginx Centos 7

install certbot

  sudo yum install epel-release
  sudo yum update
  sudo yum install certbot

install nginx

  sudo yum install nginx

sudo systemctl start nginx

@gilyes
gilyes / Backup, restore postgres in docker container
Last active January 18, 2025 00:57
Backup/restore postgres in docker container
Backup:
docker exec -t -u postgres your-db-container pg_dumpall -c > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
Restore:
cat your_dump.sql | docker exec -i your-db-container psql -Upostgres
@castorflex
castorflex / ASCIIFolding.java
Last active February 24, 2023 21:49
Java ASCII Folding
public class ASCIIFolding {
@NonNull
public static String foldToASCII(@NonNull String input) {
return foldToASCII(input, new StringBuilder(input.length()));
}
@NonNull
public static String foldToASCII(@NonNull String input, @NonNull StringBuilder sb) {
final int end = input.length();
@cortesben
cortesben / Angular-cli.md
Last active July 31, 2024 18:45
Bash commands and Angular CLI commands

#Angular-cli oh shit!

https://cli.angular.io/reference.pdf

Commands Description
ng help returns all commands with flags they can take as a param
ng new [project-name] create a brand new angular project with live server BANG!
ng init grabs name from folder that already exist
@jasperf
jasperf / gist:c189ae315719f1e5ddd5
Created November 28, 2015 03:36
Check to see what process is listen on a certain port #osx #centos #netstat #lsof
##OSX
## Lsof or list open files
lsof -n -i4TCP:8085 | grep LISTEN
##CentOS
##netstat or network tools
##$PORT is port of choice
netstat -ln |grep $PORT
@mandiwise
mandiwise / Update remote repo
Last active March 22, 2025 05:41
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
@ianjuma
ianjuma / nginx subdomains config
Last active December 6, 2020 13:41
Nginx subdomain sample config
worker_processes 5;
error_log /var/log/nginx/error.log;
pid /var/log/nginx/nginx.pid;
worker_rlimit_nofile 8192;
events {
worker_connections 4096;
use epoll;
@jimothyGator
jimothyGator / README.md
Last active December 20, 2024 09:08
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)