Skip to content

Instantly share code, notes, and snippets.

@Alexhha
Alexhha / mov-2-avi.sh
Last active March 26, 2023 17:25
ffmpeg mov to avi
#!/bin/bash
cd ~/mov_2_avi/source
for curr_file in $(ls *)
do
echo "$(date)"
echo "${curr_file}"
# ffmpeg -i input.mp4 -c:v libx265 -vtag hvc1 output.avi
@Alexhha
Alexhha / main.tf
Created July 13, 2019 17:29
terraform-aws-ha-ansible-inventory
provider "aws" {
version = "~> 2.0"
profile = "personal"
region = "${var.region}"
}
data "aws_availability_zones" "healthy_zones" {
state = "available"
}
[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"
$url = "https://github.com/ojdkbuild/ojdkbuild/releases/download/11.0.3-1/java-11-openjdk-11.0.3.7-1.windows.ojdkbuild.x86_64.msi"
$file = "C:\Users\alex\Downloads\java-11-openjdk-11.0.3.7-1.windows.ojdkbuild.x86_64.msi"
(New-Object -TypeName System.Net.WebClient).DownloadFile($url, $file)
$installJava = (Start-Process -FilePath "msiexec.exe" -ArgumentList "/i C:\Users\alex\Downloads\java-11-openjdk-11.0.3.7-1.windows.ojdkbuild.x86_64.msi /quiet" -Wait -Passthru).ExitCode
Write-VerboseLog "Install Java code $installJava."
@Alexhha
Alexhha / main.tf
Created April 22, 2019 14:22
terraform-aws-dynamic-ami-id.tf
data "aws_ami" "linux_ami" {
most_recent = true
owners = ["${element(split(";", var.ami_id_filter[var.linux_distro]), 1)}"]
filter {
name = "name"
values = ["${element(split(";", var.ami_id_filter[var.linux_distro]), 0)}"]
}
filter {
{
"action": "get",
"node": {
"dir": true,
"nodes": [{
"key": "/eplus-etcd-test",
"dir": true,
"nodes": [{
"key": "/eplus-etcd-test/edge",
"dir": true,
FROM base/archlinux:latest
MAINTAINER Tiago de Paula Peixoto <[email protected]>
RUN echo 'Server=https://archive.archlinux.org/repos/2017/11/23/$repo/os/$arch' > /etc/pacman.d/mirrorlist
#RUN pacman-key --refresh-keys
RUN pacman -Syu --noconfirm
RUN pacman -S binutils make gcc patch fakeroot --noconfirm --needed
RUN pacman -S expac yajl git --noconfirm --needed
RUN pacman -S sudo grep file --noconfirm --needed
server {
listen 443 ssl;
server_name staging.example.com;
charset utf-8;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_prefer_server_ciphers on;
#!/bin/bash
for package_name in {a..z}
do
for page in {1..25}
do
curl -s "https://pypi.org/search/?q=${package_name}&page=${page}" \
| grep -o -E 'href="/project/.*' | cut -d '>' -f1 | cut -d '"' -f2 \
| sed -r 's|(.*)|https://pypi.org/\1#files|' \
| while read curr_line
try {
node('master'){
stage('STAGE1'){
echo 'EXECUTE STAGE1'
}
stage('STAGE2'){
echo 'EXECUTE STAGE2'
}
#!/bin/bash
PATH_PREFIX=/opt/upload/10k
zipinfo -1 100k.zip | grep -v /$ | head -10000 | while read curr_file
do
curr_dir=$(dirname ${curr_file})
if [[ ! -d ${PATH_PREFIX}/${curr_dir} ]]; then
mkdir -p ${PATH_PREFIX}/${curr_dir}