Skip to content

Instantly share code, notes, and snippets.

🎸
Focusing

DY-L dyllanwli

🎸
Focusing
Block or report user

Report or block dyllanwli

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dyllanwli
dyllanwli / Pdf2JpegConverter.java
Created Jul 23, 2019
convert PDF to JPEG/multi-page tiff/image-pdf files
View Pdf2JpegConverter.java
package org.doc2pdf.lambda;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import javax.imageio.ImageIO;
@dyllanwli
dyllanwli / s3.sh
Last active Jun 5, 2019
aws s3 command
View s3.sh
aws --version
# aws-cli/1.15.30 Python/3.6.5 Darwin/17.6.0 botocore/1.10.30
# move or rename bucket
aws s3 mb s3://[new-bucket]
aws s3 mv s3://old-bucket s3://new-bucket --recursive
# or
aws s3 mb s3://[new-bucket]
aws s3 sync s3://[old-bucket] s3://[new-bucket]
@dyllanwli
dyllanwli / alphabet.py
Last active May 19, 2019
List all alphabet
View alphabet.py
# build-in package
import string
string.ascii_lowercase
# 'abcdefghijklmnopqrstuvwxyz'
list(string.ascii_lowercase)
# or
list(map(chr, range(97, 123)))
# ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
@dyllanwli
dyllanwli / copyfile.sh
Created May 13, 2019
Some linux command
View copyfile.sh
# linux command . Copy a file one hundred times
for n in {001..100}; do
cp file.jpg file-$n.jpg
done
@dyllanwli
dyllanwli / single_convert.sh
Created May 13, 2019
Libreoffice headless convert doc to pdf
View single_convert.sh
echo "hello world" > a.txt
soffice --headless --invisible --nodefault --nofirststartwizard \
--nolockcheck --nologo --norestore --convert-to pdf --outdir $(pwd) a.txt
# to run multiple convert just use * as a selector
View gist:5c76fe5a285700acc052a79e61e264ec
$(<command> | grep <something I want to grep> | awk '{print <the line I wants to get, e.g. $1>}')
@dyllanwli
dyllanwli / gist:37a9ca3d3085087cc59d0f62809cd0a2
Last active May 13, 2019
Docker SwitchDaemon on Windows
View gist:37a9ca3d3085087cc59d0f62809cd0a2
cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchDaemon
# I should switch back if I still needs the original Daemon
You can’t perform that action at this time.