Skip to content

Instantly share code, notes, and snippets.

View hiyali's full-sized avatar
🌎
Focusing

Salam Hiyali hiyali

🌎
Focusing
View GitHub Profile
@hiyali
hiyali / upload-file-to-amazon-s3-golang.md
Last active November 20, 2023 08:32
Upload file to amazon s3 with s3 filepath on golang

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
@hiyali
hiyali / A-lumen-route-resource-example.md
Last active January 1, 2021 02:50
lumen-route-resource

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
package main
import (
"fmt"
"time"
"sync"
)
func work(serverChan chan int, wg *sync.WaitGroup, server int, thing string) {
defer wg.Done()
@hiyali
hiyali / optimize_linux.md
Last active June 9, 2019 06:40
Optimize Linux

Find fd limit:

cat /proc/sys/fs/file-max

Check limit:

ulimit -n
@hiyali
hiyali / After_increase_volume_size.md
Last active March 19, 2019 11:24
After increase volume size

Expand Partition to New Available Disk Volume

$ sudo growpart /dev/xvda 1

Expand file system

$ sudo resize2fs /dev/xvda1
@hiyali
hiyali / capslock-instead-to-ctrl.md
Last active March 19, 2019 11:21
capslock-instead-to-ctrl

debian, ubuntu etc...

Open the following for editing

sudo nvim /etc/default/keyboard

And edit

XKBOPTIONS="ctrl:swapcaps"

Then, reconfigure:

@hiyali
hiyali / cordova-wechat-share-app-delegate.md
Created March 23, 2018 11:27
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");
 }
sudo apt install i3 i3status dmenu i3lock xbacklight feh conky compton rofi
(and i3 gaps?)
i3-gaps # window border
feh # wall paper
rofi # like os X win+l (could open any application)
compton # for conky alpha
conky # manual configuration desktop
i3 # window manager
i3-status # i3 status bar
@hiyali
hiyali / php7-laravel-installation
Last active February 23, 2017 06:25
install php7 and laravel
### 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 ###