Skip to content

Instantly share code, notes, and snippets.

@zieru
zieru / README.md
Created December 18, 2023 07:02 — forked from DeadSix27/README.md
Example Nginx & PHP-FPM systemd service configs.

Example Nginx & PHP-FPM systemd service configs

A set of really basic systemd configs for starting Nginx and PHP-FPM on system boot.

  • Ensures Nginx web server has started before starting the PHP-FPM process.
  • PHP-FPM pid file placed at /run/php7/php-fpm.pid, PHP7 PHP-FPM config at /etc/php7.
  • Based on usage with Ubuntu 16.04LTS.

Both scripts placed in /lib/systemd/system and enabled by the following:

@zieru
zieru / open_folder_in_PhpStorm_2019.bat
Last active November 8, 2020 07:58 — forked from ibrahimhajjaj/open_folder_in_PhpStorm_2020.bat
windows add context open folder in PhpStorm 2020 on right click..
@echo off
SET PhpStormPath=C:\Program Files\JetBrains\PhpStorm 2019.2.3\bin\phpstorm64.exe
echo Adding file entries
@reg add "HKEY_CLASSES_ROOT\*\shell\PhpStorm" /t REG_SZ /v "" /d "Open in PhpStorm" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\PhpStorm" /t REG_EXPAND_SZ /v "Icon" /d "%PhpStormPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\PhpStorm\command" /t REG_SZ /v "" /d "%PhpStormPath% \"%%1\"" /f
echo Adding within a folder entries
@zieru
zieru / RouterApp.js
Created November 4, 2019 04:50 — forked from VesperDev/RouterApp.js
Sider menu + ant-design + react-router-dom
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import { Layout, Menu, Icon } from 'antd';
import Dashboard from './containers/Dashboard/Dashboard';
import Meseros from './containers/Meseros/Meseros';
const { Header, Content, Footer, Sider } = Layout;
const SubMenu = Menu.SubMenu;
@zieru
zieru / sample_crypto_aes.js
Created August 20, 2019 07:38 — forked from dudepare/sample_crypto_aes.js
This is a sample of AES encryption + decryption using CryptoJS. This is a bit different from the examples out there because this one uses a COMPANY header + payload. There's a little bit more processing going on. I also used a CDN for CryptoJS. I hope someone finds this useful.
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/components/core-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/components/sha256.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/components/enc-base64.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js"></script>
<script>
function toWordArray(str){
return CryptoJS.enc.Utf8.parse(str);
}
function toString(words){
@zieru
zieru / my-service.service
Created April 11, 2019 02:22 — forked from ccarrasc/my-service.service
Install a Node.js service for systemctl on CentOS 7
[Unit]
After=network.target
[Service]
ExecStart=/usr/bin/node /var/node/my-service/app.js
#Type=forking
Restart=always
StandardOutput=syslog
TimeoutSec=90
SyslogIdentifier=my-service