Skip to content

Instantly share code, notes, and snippets.

View ProMasoud's full-sized avatar
😃
Focusing

Masoud Tavakkoli ProMasoud

😃
Focusing
View GitHub Profile
@minio
minio / gist:6982551
Created October 14, 2013 21:30
query to get all posts and associated categories from Wordpress database
$all_posts = $wpdb->get_results("
SELECT wp_posts.ID,wp_posts.post_date,wp_posts.post_title,wp_posts.post_name,
wp_terms.name,wp_terms.slug,wp_term_taxonomy.description
from wp_posts
join wp_term_relationships on wp_posts.ID = wp_term_relationships.object_id
join wp_terms on wp_term_relationships.term_taxonomy_id = wp_terms.term_id
join wp_term_taxonomy on wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id
WHERE wp_posts.post_status = 'publish'
ORDER BY wp_terms.slug,wp_posts.ID;
", ARRAY_A);
@cagataycali
cagataycali / babelInterpreter.sh
Created July 8, 2016 16:28
Start pm2 process with babel-node interpreter
pm2 start app.js --interpreter ./node_modules/.bin/babel-node
@denji
denji / README.md
Last active October 17, 2024 15:35 — forked from Cubixmeister/README.md
Simple Sentry docker-compose.yml
  1. Download docker-compose.yml to dir named sentry
  2. Change SENTRY_SECRET_KEY to random 32 char string
  3. Run docker-compose up -d
  4. Run docker-compose exec sentry sentry upgrade to setup database and create admin user
  5. (Optional) Run docker-compose exec sentry pip install sentry-slack if you want slack plugin, it can be done later
  6. Run docker-compose restart sentry
  7. Sentry is now running on public port 9000
@hoandang
hoandang / php-docker-ext
Created May 20, 2017 01:12
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
@arsalanses
arsalanses / docker-bot.py
Last active October 30, 2022 12:10
Telegram Bot for checking docker status and alert if a container is not up
import requests
import subprocess
GROUP_ID = ''
BOT_TOKEN = ''
BASE_URL = f'https://api.telegram.org/bot{BOT_TOKEN}/sendMessage?chat_id={GROUP_ID}&text='
docker_ps = "echo -n <password> | sudo docker ps --format '{{.Status}}' | awk '{print $1}'"
docker_stats = "sudo docker stats --all --no-stream --format 'table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}'"