Skip to content

Instantly share code, notes, and snippets.

View beshkenadze's full-sized avatar

Aleksandr Beshkenadze beshkenadze

View GitHub Profile
@beshkenadze
beshkenadze / wsl-port-forwarding.md
Last active April 19, 2023 18:54 — forked from estsaon/wsl-port-forwarding.md
How to SSH into WSL2 on an external Window

WSL:

  1. Install openssh-server:
sudo apt install openssh-server
  1. Add or uncomment following lines in /etc/ssh/sshd_config:
@beshkenadze
beshkenadze / du.sh
Last active September 9, 2022 09:22 — forked from tsh-code/du.sh
Find largest modules / Check a docker image size
#/bin/sh
du -sh ./node_modules/* | sort -nr | grep '\dM.*'
#!/bin/sh
LATEST=$(wget -qO- "https://api.github.com/repos/docker/buildx/releases/latest" | jq -r .name)
wget https://github.com/docker/buildx/releases/download/$LATEST/buildx-$LATEST.linux-amd64
chmod a+x buildx-$LATEST.linux-amd64
mkdir -p ~/.docker/cli-plugins
mv buildx-$LATEST.linux-amd64 ~/.docker/cli-plugins/docker-buildx
echo "Done!"
#!/bin/sh
LATEST=$(wget -qO- "https://api.github.com/repos/docker/buildx/releases/latest" | jq -r .name)
wget https://github.com/docker/buildx/releases/download/$LATEST/buildx-$LATEST.linux-amd64
chmod a+x buildx-$LATEST.linux-amd64
mkdir -p ~/.docker/cli-plugins
mv buildx-$LATEST.linux-amd64 ~/.docker/cli-plugins/docker-buildx
echo "Done!"
!
! Title: My Custom filter
docker volume create rancher-data
docker run -d --name rancher --restart=unless-stopped -p 80:80 -p 443:443 -v rancher-data:/var/lib/rancher rancher/rancher --acme-domain domain.ltd
<?php
$srcImage = "./test.jpg";
list($width, $height) = getimagesize($srcImage);
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($srcImage);
imagecopyresampled($image_p,$image,0,0,0,0,100, 100, $width, $height);
imagejpeg($image_p, "./test2.jpg", 100);
@beshkenadze
beshkenadze / Dockerfile
Created April 8, 2019 17:58
PHP7 with gd (jpeg enabled)
FROM php:fpm-alpine
RUN apk update \
&& apk upgrade \
&& apk add --no-cache \
freetype \
libpng \
libjpeg-turbo \
freetype-dev \
libpng-dev \
{
"name": "token_frontender_magazine",
"version": "1.0.0",
"private": false,
"scripts": {
"start": "node ./build/server.js",
"build:dev": "babel source -s true -d build --ignore __tests__/**,__mocks__/**",
"build": "babel source --minified -s true -d build --ignore __tests__/**,__mocks__/**",
"watch": "babel source --watch --minified -s true -d build --ignore __tests__/**,__mocks__/**"
},
/**
* Module Dependencies
*/
const errors = require('restify-errors');
/**
* Model Schema
*/
const Message = require('../models/message');