Skip to content

Instantly share code, notes, and snippets.

@GrennKren
GrennKren / convert_and_resize.bat
Last active June 13, 2024 12:05
Convert and Rescale Many Images Using FFMPEG
:: FOR WINDOWS batch
: using for /f "tokens=*" %i in ('dir /aa /b /o-d')
for /f "tokens=*" %%i in ('dir /aa /b /o-d') do ffmpeg -i "%%i" -vf "scale=min'(2000,iw):-1'" "converted_jpg\%%~ni.jpg"
@GrennKren
GrennKren / Update Owncloud Server
Created June 24, 2024 06:38
Update Owncloud Server
Just Self Note:
1 ) turn on maintenance mode (in owncloud folder)
sudo -u www-data php occ maintenance:mode --on
2) turn off apache2 service
sudo systemctl stop apache2
3) rename/move previous owncloud folder to another
sudo mv owncloud owncloud_backup
@GrennKren
GrennKren / Owncloud - sync problem
Last active June 25, 2024 03:53
Owncloud - Sync Problem in Owncloud Client
1) HTTP_OC_CHUCKED OC_Chunked header "is allowed only in webdav endpoint owncloud".
This happen when after set env OWNCLOUD_CHUNKING_NG=0 ?
revert that OWNCLOUD_CHUNKING_NG to OWNCLOUD_CHUNKING_NG=1 or just remove it.
2) Connection Closed
Only works for files below 100mb?
set environment variable OWNCLOUD_MAX_CHUNK_SIZE
e.g :
OWNCLOUD_MAX_CHUNK_SIZE=10737418240 ; for 10GB (default 100000000 or 100MB)
@GrennKren
GrennKren / Java
Created June 29, 2024 18:07
All the Challenges I Faced in Java Netbeans
1) I set up JTable with setAutoCreateRowSorter(true) so that all tables can be sorted by clicking on the column headers. However, I want to exclude some tables from this, but when I try using table.setAutoCreateRowSorter(false), it doesn't work at all.
Solution:
Disable the table header with table.getTableHeader().setEnabled(false);
2)
@GrennKren
GrennKren / process_substitution.sh
Last active July 11, 2024 19:24
Linux, increment variable always getting reset inside sub loop
main="test_subtitution"
a="$main/folder_a"
b="$main/folder_b"
mkdir -p $a $b
touch $a/file_1 $a/file_5 $a/file_9 $a/file_10 $a/file_8
touch $b/file_1 $b/file_5 $b/file_9 $b/file_10 $b/file_8
@GrennKren
GrennKren / authorization_ssh.txt
Last active July 19, 2024 08:13
Handling git problem on Windows Server
client side:
generate key with:
ssh-keygen -i ed25519
take the content of id_ed25519.pub
and append it into authorized_keys (the path can be found in config)
server side:
check config