Skip to content

Instantly share code, notes, and snippets.

@eldorplus
eldorplus / youtube-listen.js
Created March 27, 2021 11:20 — forked from szkrd/youtube-listen.js
Listen to a youtube stream in puppeteer (headless chrome/chromium). By default plays Chillcow's channel, works on linux and windows, clicks on all the popup crap.
// first: `npm init -- yes && npm i chalk puppeteer-core`
// then: `node . --help`
const puppeteer = require('puppeteer-core');
const chalk = require('chalk');
// ---
const ifHasParam = (s = '') => process.argv.includes(s);
const paramValueOf = (s = '') => (process.argv.find(x => x.startsWith(`${s}=`)) || '').split('=')[1];
const DEFAULT_VIDEO_ID = '5qap5aO4i9A'; // ChillCow; his other channel is "DWcJFNfaw9c"
const DEBUG = ifHasParam('--debug');
const SHOW_HEAD = ifHasParam('--head');
@eldorplus
eldorplus / google.js
Created March 27, 2021 11:18 — forked from vrumger/google.js
Create a google account and go to youtube with puppeteer.
const puppeteer = require('puppeteer');
const uuid = require('uuid');
const sleep = ms => new Promise(r => setTimeout(r, ms));
(async () => {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
const id = uuid.v4();
@eldorplus
eldorplus / puppeteer_youtube.js
Created March 27, 2021 11:10 — forked from tnolet/puppeteer_youtube.js
Puppeteer search youtube
const puppeteer = require('puppeteer')
const screenshot = 'youtube_fm_dreams_video.png'
try {
const browser = await puppeteer.launch()
const page = await browser.newPage()
await page.goto('https://youtube.com')
await page.type('#search', 'Fleetwood Mac Dreams')
await page.click('button#search-icon-legacy')
await page.waitForSelector('ytd-thumbnail.ytd-video-renderer')
@eldorplus
eldorplus / install-nodejs-kali-linux.sh
Last active March 4, 2021 15:11 — forked from shizonic/install-nodejs-kali-linux.sh
Install nodeJS on Kali Linux
#!/bin/bash
sudo apt-get update -y
sudo apt-get install python g++ make checkinstall fakeroot -y
src=$(mktemp -d) && cd $src
wget -N http://nodejs.org/dist/node-latest.tar.gz
tar xzvf node-latest.tar.gz && cd node-v*
./configure
sudo fakeroot checkinstall -y --install=no --pkgversion $(echo $(pwd) | sed -n -re's/.+node-v(.+)$/\1/p') make -j$(($(nproc)+1)) install
sudo dpkg -i node_*
@eldorplus
eldorplus / resign.sh
Created January 27, 2021 09:09 — forked from seanhenry/resign.sh
Resign an ipa and change the build number
APPNAME=App
BUILDNUMBER=123
CERTIFICATE="iPhone Distribution"
cp "${APPNAME}.ipa" "${APPNAME}.zip"
mkdir contents || true
unzip "${APPNAME}.zip" -d contents
codesign -d --entitlements :Entitlements.plist "contents/Payload/${APPNAME}.app"
plutil -replace CFBundleVersion -string "${BUILDNUMBER}" "contents/Payload/${APPNAME}.app/Info.plist"
rm -r "contents/Payload/${APPNAME}.app/_CodeSignature"
@eldorplus
eldorplus / rdesktop-gui
Created December 4, 2020 09:28 — forked from zeroSteiner/rdesktop-gui
Python rdesktop GUI
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# rdesktop-gui
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
@eldorplus
eldorplus / tvfr
Created August 28, 2020 10:08 — forked from dell38/tvfr
#EXTINF:-1, TF1
http://pebbles109-lh.akamaihd.net/i/tf1_1@97468/index_900_av-b.m3u8|User-Agent=Mozilla%2F5.0%20(iPhone%3B%20U%3B%20CPU%20iPhone%20OS%203_0%20like%20Mac%20OS%20X%3B%20en-us)%20AppleWebKit%2F528.18%20(KHTML%2C%20like%20Gecko)%20Version%2F4.0%20Mobile%2F7A341%20Safari%2F528.16&X-Forwarded-For=146.159.95.38
#EXTINF:-1 ,TF1
http://wpc.e803.mucdn.net/80E803/enco35-tnt/hls/m3u8/tf1hl874093481.m3u8
#EXTINF:-1,France 2 HD
http://pebbles101-lh.akamaihd.net/i/france2_1@97347/index_900_av-b.m3u8|X-Forwarded-For=146.159.95.38
#EXTINF:-1,France 3
@eldorplus
eldorplus / README-tomcat-as-systemd-service.md
Created June 9, 2020 16:48 — forked from drmalex07/README-tomcat-as-systemd-service.md
An example configuration for Tomcat as systemd service. #tomcat #systemd #systemd.service

README

Let Tomcat is download and installed under /opt/tomcat. Also, let tomcat be a non-provileged user under which the server will be running.

We assume that we keep server's binaries under /opt/tomcat and we will create a server instance named foo under /var/tomcat/ (carrying its own conf, logs, webapps, work, lib directories). See also https://dzone.com/articles/running-multiple-tomcat.

Create a template service unit file at /etc/systemd/system/[email protected]:

@eldorplus
eldorplus / tomcat.service
Created June 9, 2020 16:45 — forked from zengxs/tomcat.service
tomcat systemd service script
# Systemd unit file for tomcat
[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target
[Service]
Type=forking
Environment=JAVA_HOME=/usr/lib/jvm/jre
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
@eldorplus
eldorplus / Apache Tomcat 8 Start stop script init.d script
Created June 9, 2020 16:25 — forked from miglen/Apache Tomcat 8 Start stop script init.d script
Apache Tomcat init script (or startup/controll script). Works fine for version 7/8. Read the comments for release history. Feel free to modify, copy and give suggestions. (c) GNU General Public License
#!/bin/bash
#
# description: Apache Tomcat init script
# processname: tomcat
# chkconfig: 234 20 80
#
#
# Copyright (C) 2014 Miglen Evlogiev
#
# This program is free software: you can redistribute it and/or modify it under