Skip to content

Instantly share code, notes, and snippets.

Avatar
🌎
Focusing

Salam Hiyali hiyali

🌎
Focusing
View GitHub Profile
View simple-golang-pool-example.go
package main
import (
"fmt"
"time"
"sync"
)
func work(serverChan chan int, wg *sync.WaitGroup, server int, thing string) {
defer wg.Done()
@hiyali
hiyali / upload-file-to-amazon-s3-golang.md
Last active Oct 7, 2021
Upload file to amazon s3 with s3 filepath on golang
View upload-file-to-amazon-s3-golang.md

syncer.go

/*
  https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object-acl.html
  https://docs.aws.amazon.com/zh_cn/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html
  https://github.com/awslabs/aws-go-wordfreq-sample/blob/master/cmd/uploads3/main.go
  https://docs.aws.amazon.com/sdk-for-go/api/aws/

  1. Create bucket in s3 & get the keys
  - login to UI web aws s3 interface
View optimize_linux.md

Find fd limit:

cat /proc/sys/fs/file-max

Check limit:

ulimit -n
@hiyali
hiyali / After_increase_volume_size.md
Last active Mar 19, 2019
After increase volume size
View After_increase_volume_size.md

Expand Partition to New Available Disk Volume

$ sudo growpart /dev/xvda 1

Expand file system

$ sudo resize2fs /dev/xvda1
@hiyali
hiyali / cordova-wechat-share-app-delegate.md
Created Mar 23, 2018
cordova-wechat-share-app-delegate.md
View cordova-wechat-share-app-delegate.md

修改文件AppDelegate+IonicDeeplink.m的openURL方法,内容改成下面的:

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    BOOL handled = NO;

    if ([[url absoluteString] rangeOfString:@"liepiao"].location == 0) {
        IonicDeeplinkPlugin *plugin = [self.viewController getCommandInstance:PLUGIN_NAME];
        if(plugin == nil) {
            NSLog(@"Unable to get instance of command plugin");
        }
@hiyali
hiyali / capslock-instead-to-ctrl.md
Last active Mar 19, 2019
capslock-instead-to-ctrl
View capslock-instead-to-ctrl.md

debian, ubuntu etc...

Open the following for editing

sudo nvim /etc/default/keyboard

And edit

XKBOPTIONS="ctrl:swapcaps"

Then, reconfigure:

View A-lumen-route-resource-example.md

Files

Route

./routes/Resource.php # get model resource
./routes/web.php # include and define resource

Controller

./app/Http/Controllers/RestfulControllerTrait.php # restful trait
./app/Http/Controllers/Controller.php # use restful trait
@hiyali
hiyali / xdebug-install-php7
Created Oct 9, 2016 — forked from kamilZ/xdebug-install-php7
Install xdebug from sources php7.0
View xdebug-install-php7
sudo apt-get install php7.0-dev
wget http://xdebug.org/files/xdebug-2.4.0rc2.tgz
tar -xzf xdebug-2.4.0rc2.tgz
cd xdebug-2.4.0RC2/
phpize
./configure --enable-xdebug
make
sudo cp modules/xdebug.so /usr/lib/.
#FOR FPM
sudo echo 'zend_extension="/usr/lib/xdebug.so"' > /etc/php/7.0/fpm/conf.d/20-xdebug.ini
@hiyali
hiyali / php7-laravel-installation
Last active Feb 23, 2017
install php7 and laravel
View php7-laravel-installation
### install php 7 ###
sudo apt-get install php7.0 php7.0-fpm php7.0-mysql -y
### install laravel ###
composer global require "laravel/installer"
### install requirements ###
sudo apt install php-gd php-zip phpunit php-mbstring
### new project ###