Skip to content

Instantly share code, notes, and snippets.

View ahmed-abdelazim's full-sized avatar

Ahmed Abdeazim ahmed-abdelazim

View GitHub Profile
@cgaete
cgaete / 3.txt
Last active August 14, 2019 20:09
Configure a Firewall and a Startup Script with Deployment Manager
resources:
- name: my-default-allow-http
type: compute.v1.firewall
properties:
targetTags: ["http"]
sourceRanges: ["0.0.0.0/0"]
allowed:
- IPProtocol: TCP
ports: ["80"]
- type: compute.v1.instance
@ammar0466
ammar0466 / gist:058c4c4c975cf946e5b292c02ee67022
Last active January 20, 2024 06:56
Install Windows 10 on digital ocean
How to install windows on digital ocean,
use this tutorial :
https://milankragujevic.com/how-to-install-windows-10-on-digitalocean
how to create own image :
Reans Web - Creating Custom Image on Digital Ocean '(2022 Update)'
Click here to watch on youtube : https://youtu.be/wtHBDEl5DIw
@eddmann
eddmann / start-stop-ec2-instances.js
Created November 3, 2017 14:00
Scheduled Start/Stop of EC2 Instances using Lambda and CloudWatch Events
// Demonstration video can be found at: https://youtu.be/roAerKVfq-Y
// StopEC2Instance
const AWS = require('aws-sdk');
exports.handler = (event, context, callback) => {
const ec2 = new AWS.EC2({ region: event.instanceRegion });
ec2.stopInstances({ InstanceIds: [event.instanceId] }).promise()
@magnetikonline
magnetikonline / README.md
Last active February 4, 2024 07:45
List all Git repository objects by size.

List all Git repository objects by size

Summary

Bash script to:

  • Iterate all commits made within a Git repository.
# This is my solution to the programming problen posted as part of
# Udacity's Intro to Programming Nanodegree.
# Original problem statement:
# Given your birthday and the current date, calculate your age
# in days. Compensate for leap days. Assume that the birthday
# and current date are correct dates.
# Simply put, if you were born 1 Jan 2012 and todays date is
# 2 Jan 2012 you are 1 day old.
@ziadoz
ziadoz / install.sh
Last active April 20, 2024 10:18
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE`
@om4james
om4james / functions.php
Last active April 1, 2024 19:21
Display product description on WooCommerce shop/category pages
<?php
/**
* Add the product's short description (excerpt) to the WooCommerce shop/category pages. The description displays after the product's name, but before the product's price.
*
* Ref: https://gist.github.com/om4james/9883140
*
* Put this snippet into a child theme's functions.php file
*/
function woocommerce_after_shop_loop_item_title_short_description() {
global $product;
@olasd
olasd / stream_to_youtube.sh
Created March 28, 2014 19:58
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@umidjons
umidjons / grep-ps-without-grep.sh
Created November 22, 2013 12:27
Remove grep command while grepping something using ps command
# -v reverse matching, and then search for text 'parse.php'
ps ajx | grep -v grep | grep -c parse.php
# outputs, for example:
2
@simonlk
simonlk / Woocommerce - show empty categories
Created October 21, 2012 06:33
Show empty categories within Woocommerce. Paste this in to your theme's functions file. It's just a copy and paste of a function within woocommerce-template.php and changing value of hide_empty to 0
// Paste this in to your theme's functions file
// Redefine sub category display to output empty categories
function woocommerce_product_subcategories( $args = array() ) {
global $woocommerce, $wp_query, $_chosen_attributes;
$defaults = array(
'before' => '',
'after' => '',
'force_display' => false
);