Skip to content

Instantly share code, notes, and snippets.

View turkeryildirim's full-sized avatar
🏠
Working from home

Türker YILDIRIM turkeryildirim

🏠
Working from home
View GitHub Profile
@turkeryildirim
turkeryildirim / go.sql
Created December 29, 2022 18:34
sub query
deneme
@turkeryildirim
turkeryildirim / gdoc_download.sh
Created August 5, 2020 16:05
google docs file downloader
#!/bin/bash
# Get files from Google Drive
# $1 = file ID
# $2 = file name
URL="https://docs.google.com/uc?export=download&id=$1"
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate $URL -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=$1" -O $2 && rm -rf /tmp/cookies.txt
ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 40 -b:v 0 -b:a 512k -c:a libopus output.webm
ffmpeg -i video.mp4 -vcodec h264 -b:v 512k -acodec mp3 output.mp4
@turkeryildirim
turkeryildirim / custom.conf
Created November 18, 2018 22:37
ModSecurity form POST limiter
SecAction "id:9999010,phase:1,nolog,initcol:ip=%{REMOTE_ADDR}"
SecRule REQUEST_URI "!@contains /core/" "id:9999020,phase:1,nolog,chain,setvar:ip.post_attempt=+1,deprecatevar:ip.post_attempt=3/30"
SecRule REQUEST_METHOD "@streq POST" "id:9999030"
SecRule IP:POST_ATTEMPT "@gt 3" "id:9999040,log,deny,msg:'CUSTOM RULE - Possible POST request attack'"
<select>
<option value="">Seçin</option>
<option value="Adana">Adana</option>
<option value="Adıyaman">Adıyaman</option>
<option value="Afyon">Afyon</option>
<option value="Ağrı">Ağrı</option>
<option value="Aksaray">Aksaray</option>
<option value="Amasya">Amasya</option>
<option value="Ankara">Ankara</option>
<option value="Antalya">Antalya</option>
@turkeryildirim
turkeryildirim / gist:3a37c9282c9888bb53c7c3383ebdd813
Created December 15, 2017 12:23
Opera browser h264 video playback issue fix
sudo mv /usr/lib/x86_64-linux-gnu/opera/libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/1-libffmpeg.so
sudo ln -s /usr/lib/chromium-browser/libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/libffmpeg.so
@turkeryildirim
turkeryildirim / htaccess-cache
Created March 21, 2017 11:03
browser cache
# BEGIN Browser Cache
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
<FilesMatch "\.(gif|jpg|jpeg|png|swf|svg|txt|xml|js|css)$">
Header set Cache-Control "max-age=29030400, public"
</FilesMatch>
<FilesMatch "\.(bmp|class|doc|docx|eot|exe|ico|json|mdb|mpp|otf|_otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|pot|pps|ppt|pptx|svg|svgz|swf|tif|tiff|ttf|ttc|_ttf|wav|wri|woff|woff2|xla|xls|xlsx|xlt|xlw|BMP|CLASS|DOC|DOCX|EOT|EXE|ICO|JSON|MDB|MPP|OTF|_OTF|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|POT|PPS|PPT|PPTX|SVG|SVGZ|SWF|TIF|TIFF|TTF|TTC|_TTF|WAV|WRI|WOFF|WOFF2|XLA|XLS|XLSX|XLT|XLW)$">
Header unset Last-Modified
@turkeryildirim
turkeryildirim / wordpress-auth.conf
Created February 27, 2017 13:49
fail2ban wordpress filter & config
# Fail2Ban filter to block repeated failed login attempts to WordPress site(s)
#
#
[INCLUDES]
before = common.conf
[Definition]
#!/bin/bash
for i in $(ls -d /home/*); do
user=${i/\/home\/}
echo $user
chmod 750 /home/$user/public_html
find /home/$user/public_html/. -type f -exec chmod 640 {} \;