Skip to content

Instantly share code, notes, and snippets.

View sonnetmia's full-sized avatar
🏠
Working from home

Md. Ariful Islam sonnetmia

🏠
Working from home
View GitHub Profile
apt-get update
apt-get install -y ruby
wget https://aws-codedeploy-us-east-1.s3.amazonaws.com/releases/codedeploy-agent_1.0-1.1597_all.deb
mkdir codedeploy-agent_1.0-1.1597_ubuntu20
dpkg-deb -R codedeploy-agent_1.0-1.1597_all.deb codedeploy-agent_1.0-1.1597_ubuntu20
sed 's/2.0/2.7/' -i ./codedeploy-agent_1.0-1.1597_ubuntu20/DEBIAN/control
dpkg-deb -b codedeploy-agent_1.0-1.1597_ubuntu20
dpkg -i codedeploy-agent_1.0-1.1597_ubuntu20.deb
systemctl start codedeploy-agent
systemctl enable codedeploy-agent
@sonnetmia
sonnetmia / swap.config
Created June 1, 2021 13:00 — forked from aradhell/swap.config
add swap memory to elastic beanstalk
commands:
create_pre_dir:
command: "mkdir /opt/elasticbeanstalk/hooks/appdeploy/pre"
ignoreErrors: true
files:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/00_setup_swap.sh":
mode: "000755"
owner: root
group: root
content: |
@sonnetmia
sonnetmia / docker-compose.yaml
Created May 30, 2021 08:43 — forked from darth-veitcher/docker-compose.yaml
Traefik v2.0 with Cloudflare Wildcard and OpenVPN
version: "3"
services:
traefik:
image: "traefik:v2.0"
container_name: "traefik"
command:
# Globals
- "--log.level=DEBUG"
- "--api=true"
@sonnetmia
sonnetmia / wp_email_functions.php
Last active June 18, 2018 17:04
WordPress default email and Name FROM change
//use this code into your functions.php file.
function bb_sender_email( $original_email_address ) {
return '[email protected]';
}
// Function to change sender name
function bb_sender_name( $original_email_from ) {
return 'Your Name';
}
@sonnetmia
sonnetmia / opsworks-command.md
Created June 4, 2018 08:56
Useful commands for opsworks and chef 12

' app = search("aws_opsworks_app").first Chef::Log.info("********** The app's short name is '#{app['shortname']}' ") Chef::Log.info(" The app's URL is '#{app['app_source']['url']}' **********") '

@sonnetmia
sonnetmia / mysql-create-db-user.sh
Last active November 5, 2023 05:42 — forked from MagePsycho/mysql-create-db-user.sh
Bash Script: Create MySQL Database & User
#!/bin/bash
#
# Script to create MySQL db + user
#
# @author Raj KB <[email protected]>
# @website http://www.magepsycho.com
# @version 0.1.0
# Usage chmod +x ./mysql-create-db-user.sh
# ./mysql-create-db-user.sh --host=localhost --database=test-db --user=test-user
@sonnetmia
sonnetmia / query.sql
Created June 29, 2016 02:30
Whmcs Upgrade Server
UPDATE tblhosting SET server='2' WHERE server='1';
@sonnetmia
sonnetmia / WC Post Excerpt.php
Created June 24, 2016 13:36
Woocommerce Post Excerpt Lenght Control For Short Description
function string_limit_words($string, $word_limit)
{
$words = explode(' ', $string, ($word_limit + 1));
if(count($words) > $word_limit)
array_pop($words);
return implode(' ', $words);
}
function hook_some_content_into_content_product_page(){
@sonnetmia
sonnetmia / wp-config.php
Created June 20, 2016 14:56
Force WordPress update without ftp info in some case.
<?php
/** Sets up 'direct' method for WordPress to FTP, without requiring credentials */
define('FS_METHOD', 'direct');
/** Defines permissions for WordPress to apply to new directories */
define('FS_CHMOD_DIR', ( 0755 & ~ umask() ) );
/** Defines permissions for WordPress to apply to new files */
define('FS_CHMOD_FILE', ( 0664 & ~ umask() ) );
@sonnetmia
sonnetmia / functions.php
Created June 2, 2016 05:24 — forked from claudiosanches/functions.php
WooCommerce - Hide free shipping if others methods exists
<?php
/**
* Hide free shipping if others methods exists.
*
* @param array $available_methods
*/
function custom_shipping_rules( $available_methods ) {
if ( isset( $available_methods['PAC'] ) || isset( $available_methods['SEDEX'] ) ) {
unset( $available_methods['free_shipping'] );