Skip to content

Instantly share code, notes, and snippets.

View sharifbdp's full-sized avatar

Sharif sharifbdp

View GitHub Profile
সার্ভারের প্রাথমিক এবং ব্যাসিক কনফিগারেশন
1. নতুন তৈরি হওয়া সার্ভারে root ইউজার হিসেবে লগইন করুন নিচের কমান্ড দিয়ে
ssh root@SERVER_IP_ADDRESS
2. নতুন একটি ইউজার তৈরি করতে কমান্ড দিন নিচের মত। এখানে নতুন ইউজারের নাম demo
adduser demo
$string_to_sign = 'ASASASASASASA';
$password = '123456';
$signature = base64_encode(hash_hmac("sha256", $string_to_sign, $password, True));
echo($signature);
#https://vagrantcloud.com/ubuntu/boxes/trusty64/versions/14.04/providers/virtualbox.box
<?php
function getx($img, $font, $text) {
$image_width = imagesx($img);
$string_width = imagefontwidth($font) * strlen($text);
return $string_x_position = ($image_width - $string_width) / 2;
}
function gety($img, $font, $text) {
$image_height = imagesy($img);
import requests
url = 'http://localhost/myApp/api/v1'
params = {
'userid' : '250',
'gpslat': '30.098',
'gpslng': '40.000',
'speed': '20'
}
@sharifbdp
sharifbdp / gist:91457ea4af012ee5f30d
Created February 25, 2016 05:11
Image Upload into S3 (CodeIgniter)
/**
* File Upload into Amazon S3
* @param string $input_name
* @param int $restaurant_id
* @return string/bolean
*/
public function _fileUpload($input_name, $restaurant_id) {
if (isset($_FILES[$input_name]) && ($_FILES[$input_name]) != NULL) {
/**
* File Upload into Amazon S3
* @param string $input_name
* @param int $restaurant_id
* @return string/bolean
*/
public function _fileUpload($input_name, $restaurant_id) {
if (isset($_FILES[$input_name]) && ($_FILES[$input_name]) != null) {