Skip to content

Instantly share code, notes, and snippets.

@ntccloud
ntccloud / install-docker.sh
Created November 16, 2022 02:38 — forked from madkoding/install-docker-deepin.sh
Install Docker-CE script for Deepin Linux
#!/bin/sh
# Shell script to add docker-ce to Deepin Linux repositories
# Remove old docker
sudo apt-get remove -y docker docker-engine docker.io containerd runc
# Install dependencies
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
@ntccloud
ntccloud / vtt2text.py
Created August 27, 2022 04:42 — forked from glasslion/vtt2text.py
This script convert youtube subtitle file(vtt) to plain text.
"""
Convert YouTube subtitles(vtt) to human readable text.
Download only subtitles from YouTube with youtube-dl:
youtube-dl --skip-download --convert-subs vtt <video_url>
Note that default subtitle format provided by YouTube is ass, which is hard
to process with simple regex. Luckily youtube-dl can convert ass to vtt, which
is easier to process.
@ntccloud
ntccloud / php_substring_html.php
Created March 31, 2022 05:48 — forked from getmanzooronline/php_substring_html.php
PHP Substring without breaking words and HTML tags
<?php
/**
* Truncates text.
*
* Cuts a string to the length of $length and replaces the last characters
* with the ending if the text is longer than length.
*
* @param string $text String to truncate.
* @param integer $length Length of returned string, including ellipsis.
* @param string $ending Ending to be appended to the trimmed string.
@ntccloud
ntccloud / functions.php
Created February 16, 2022 05:01 — forked from lukecav/functions.php
How to change ‘select options’ ‘add to cart’ button text in WooCommerce
add_filter( 'woocommerce_product_add_to_cart_text' , 'custom_select_options_text' );
function custom_select_options_text() {
global $product;
$product_type = $product->product_type;
switch ( $product_type ) {
case 'subscription':
return __( 'Options', 'woocommerce' ); /*change 'Options' for Simple Subscriptions */
case 'variable-subscription':
return __( 'Options', 'woocommerce' ); /*change 'Options' for Variable Subscriptions */
case 'variable':
@ntccloud
ntccloud / skip-to-check-out.php
Created September 6, 2021 14:47 — forked from micc83/skip-to-check-out.php
Skip cart and redirect to direct checkout on WooCommerce
<?php
/**
* Skip cart and redirect to direct checkout
*
* @package WooCommerce
* @version 1.0.0
* @author Alessandro Benoit
*/
// Skip the cart and redirect to check out url when clicking on Add to cart
@ntccloud
ntccloud / filter.d_nginx-auth.conf
Created August 15, 2021 16:33 — forked from JulienBlancher/filter.d_nginx-auth.conf
Fail2ban Config with Nginx and SSH
#
# Auth filter /etc/fail2ban/filter.d/nginx-auth.conf:
#
# Blocks IPs that makes too much accesses to the server
#
[Definition]
failregex = ^<HOST> -.*"(GET|POST).*HTTP.*"
ignoreregex =
@ntccloud
ntccloud / AdbCommands
Created July 21, 2021 14:50 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@ntccloud
ntccloud / README.md
Created July 10, 2021 01:46 — forked from jamesmishra/README.md
Using Terraform to run a docker-compose.yml file directly on an Amazon EC2

Introduction

This is a Hashicorp Terraform module that provisions an AWS EC2 instance for the purpose of running a given docker-compose.yml file.

Usage

# ===== OUR MAGIC DOCKER-COMPOSE.YML FILE HERE =====
# It is also possible to get Terraform to read an external `docker-compose.yml`
# file and load it into this variable.
# We'll be showing off a demo nginx page.
// start with:
// frida -U -l pinning.js -f [APP_ID] --no-pause
Java.perform(function () {
console.log('')
console.log('===')
console.log('* Injecting hooks into common certificate pinning methods *')
console.log('===')
var X509TrustManager = Java.use('javax.net.ssl.X509TrustManager');
@ntccloud
ntccloud / encryption_openssl_salt.php
Created April 19, 2020 02:58 — forked from nim4n136/encryption_openssl_salt.php
Encryption & Decryption salt in PHP with OpenSSL
<?php
function encrypt($data, $password){
$iv = substr(sha1(mt_rand()), 0, 16);
$password = sha1($password);
$salt = sha1(mt_rand());
$saltWithPassword = hash('sha256', $password.$salt);
$encrypted = openssl_encrypt(