Skip to content

Instantly share code, notes, and snippets.

View mhemrg's full-sized avatar

Mohammad Hossein Ebadollahi mhemrg

View GitHub Profile
@mhemrg
mhemrg / PVE-HP-ssacli-smart-storage-admin.md
Created April 14, 2022 11:25 — forked from mrpeardotnet/PVE-HP-ssacli-smart-storage-admin.md
HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.

Installation

@mhemrg
mhemrg / s3-in-laravel.php
Last active April 4, 2021 14:55 — forked from ukautz/s3-in-laravel.php
Using S3 client directly in Laravel | Copy file between buckets
<?php
/** @var \Illuminate\Filesystem\FilesystemAdapter $fs */
$fs = \Storage::disk('liara');
/** @var \League\Flysystem\Filesystem $driver */
$driver = $fs->getDriver();
/** @var \League\Flysystem\AwsS3v3\AwsS3Adapter $adapter */
$adapter = $driver->getAdapter();
@mhemrg
mhemrg / README.md
Last active January 22, 2021 15:35
WordPress in a subdirectory
  1. Go to Settings -> General
  2. Change Wordpress URL and Site URL to https://domain.ir/blog
  3. Create the liara_nginx.conf in a static app with the following content and deploy it.
  4. Update wp-config.php.

You're good to go.

@mhemrg
mhemrg / mail.js
Created January 4, 2021 13:46
Email example
transporter.sendMail({ from: 'password@jedalgame.ir', to: email, subject: 'password reset', html: '<h1>hi</h1>' })
.then(() => console.log('Email sent.'))
.catch(console.error)
location /static {
alias /usr/src/app/staticfiles;
}
location / {
try_files $uri @django_app;
client_max_body_size 100M;
}
location ~\.sqlite3$ {
ERROR in ./node_modules/bootstrap/dist/js/bootstrap.esm.js
Module not found: Error: Can't resolve '@popperjs/core' in '/app/node_modules/bootstrap/dist/js'
resolve '@popperjs/core' in '/app/node_modules/bootstrap/dist/js'
Parsed request is a module
using description file: /app/node_modules/bootstrap/package.json (relative path: ./dist/js)
Field 'browser' doesn't contain a valid alias configuration
resolve as module
/app/node_modules/bootstrap/dist/js/node_modules doesn't exist or is not a directory
/app/node_modules/bootstrap/dist/node_modules doesn't exist or is not a directory
/app/node_modules/bootstrap/node_modules doesn't exist or is not a directory
location /static {
alias /usr/src/app/static;
}
location / {
try_files $uri @django_app;
client_max_body_size 100M;
}
location ~\.sqlite3$ {
@mhemrg
mhemrg / gist:0408ffb88fafbfaf6a9ef7b7148b1b0e
Created December 2, 2020 07:21
Flask app.run example
if __name__ == '__main__':
app.run(debug=True)
@mhemrg
mhemrg / gist:45dc70b80073564df5162600290f6f1c
Created November 18, 2020 13:02
Disable http_proxy on Windows
set http_proxy=
set HTTP_PROXY=
set https_proxy=
set HTTPS_PROXY=
@mhemrg
mhemrg / bull.js
Created November 15, 2020 10:26
Connecting Bull queue to Redis
BullModule.registerQueue({
name: 'sms',
redis: {
host: process.env.REDIS_HOST || 'localhost',
port: parseInt(process.env.REDIS_PORT, 10) || 6379,
password: process.env.REDIS_PASSWORD,
},
})