Skip to content

Instantly share code, notes, and snippets.

Avatar

iskandarsaleh iskandarsaleh

View GitHub Profile
@iskandarsaleh
iskandarsaleh / kafka.sh
Created Jul 28, 2020 — forked from rmzamora/kafka.sh
kafka start/stop script
View kafka.sh
#! /bin/sh
### BEGIN INIT INFO
# Provides: kafka
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: a distributed commit log.
# Description: Apache Kafka is publish-subscribe messaging rethought
# as a distributed commit log.
@iskandarsaleh
iskandarsaleh / docker_wordpress.md
Created Feb 18, 2019 — forked from bradtraversy/docker_wordpress.md
Docker Compose FIle For Wordpress, MySQL & phpmyadmin
View docker_wordpress.md

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@iskandarsaleh
iskandarsaleh / OAuth1AuthorizationUtil.groovy
Created Feb 15, 2019 — forked from andyjduncan/OAuth1AuthorizationUtil.groovy
Generating an OAuth1 Authorization header with HMAC-SHA1 in Groovy
View OAuth1AuthorizationUtil.groovy
import org.apache.commons.lang.RandomStringUtils
import javax.crypto.Mac
import javax.crypto.spec.SecretKeySpec
class OAuth1AuthorizationUtil {
public static String generateOAuthAuthorizationHeader(String method, String url, String consumerKey, String consumerSecret) {
generateOAuthAuthorizationHeader(method, url, consumerKey, consumerSecret, [:])
View postgres_queries_and_commands.sql
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@iskandarsaleh
iskandarsaleh / Dockerfile
Created Dec 30, 2018 — forked from gustavomcarmo/Dockerfile
Example of Ansible playbook for building a custom Jenkins Docker image and running it in a remote host.
View Dockerfile
FROM jenkins/jenkins:lts
LABEL maintainer "Gustavo Muniz do Carmo <gustavo@esign.com.br>"
ENV JAVA_OPTS="-Djenkins.install.runSetupWizard=false"
COPY config-maven.groovy /usr/share/jenkins/ref/init.groovy.d/
COPY config-sonarqube.groovy /usr/share/jenkins/ref/init.groovy.d/
COPY harden-jenkins.groovy /usr/share/jenkins/ref/init.groovy.d/
COPY default-user.groovy /usr/share/jenkins/ref/init.groovy.d/
View KatalonStudio_Get_Request.groovy
import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.checkpoint.CheckpointFactory as CheckpointFactory
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
View KatalonStudio_POST_Request.groovy
import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.checkpoint.CheckpointFactory as CheckpointFactory
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
@iskandarsaleh
iskandarsaleh / ssh.md
Created Dec 30, 2018 — forked from bradtraversy/ssh.md
SSH & DevOps Crash Course Snippets
View ssh.md

SSH Cheat Sheet

This sheet goes along with this SSH YouTube tutorial

Login via SSH with password (LOCAL SERVER)

$ ssh brad@192.168.1.29

Create folder, file, install Apache (Just messing around)

$ mkdir test

$ cd test

@iskandarsaleh
iskandarsaleh / pipenv_cheat_sheet.md
Created Dec 30, 2018 — forked from bradtraversy/pipenv_cheat_sheet.md
Pipenv cheat sheet for common commands
View pipenv_cheat_sheet.md

Pipenv Cheat Sheet

Install pipenv

pip3 install pipenv

Activate

pipenv shell
@iskandarsaleh
iskandarsaleh / node_cheerio_scraping.js
Created Dec 30, 2018 — forked from bradtraversy/node_cheerio_scraping.js
Simple example to scrape some posts and put into a CSV file using Node & Cheerio
View node_cheerio_scraping.js
const request = require('request');
const cheerio = require('cheerio');
const fs = require('fs');
const writeStream = fs.createWriteStream('post.csv');
// Write Headers
writeStream.write(`Title,Link,Date \n`);
request('http://codedemos.com/sampleblog', (error, response, html) => {
if (!error && response.statusCode == 200) {
You can’t perform that action at this time.