Skip to content

Instantly share code, notes, and snippets.

Aysad Kozanoglu AysadKozanoglu

Block or report user

Report or block AysadKozanoglu

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
View apt-mirror-install.sh
#!/bin/sh
# Author: Aysad Kozanoglu
# Dists: debian 9, 10 (stretch buster)
# ubuntu 18 and above
which apt-get && apt-get install -y --yes apt-mirror || apt install apt-mirror -y --yes
apt-mirror
@AysadKozanoglu
AysadKozanoglu / rc-local.service
Last active Dec 5, 2019
execute rc.local on boot startup on systemd OS types
View rc-local.service
#
# file: rc-local.service
# author: Aysad Kozanoglu
# OS types: systemd
#
# Description
# ============
# execute rc.local on boot startup
# systemd-rc-local-generator if /etc/rc.local is executable.
#
@AysadKozanoglu
AysadKozanoglu / kvm-libvirt-restart-network.sh
Created Dec 4, 2019
Effectively restarting kvm/libvirt network
View kvm-libvirt-restart-network.sh
#!/bin/bash
# Author: Aysad Kozanoglu
# Effectively restarting kvm/libvirt network
set -e
set -u
NET_NAME=default
# NET_HOOK=/etc/libvirt/hooks/qemu
View default-iptables-rules-kvm.sh
# creator : Aysad Kozanoglu
# Generated by iptables-save v1.6.0
# to restore default iptable rules
# iptables-restore < iptables-kvm.rules
# iptables-kvm.rules
*mangle
:PREROUTING ACCEPT [156866:19045743]
:INPUT ACCEPT [156851:19044573]
:FORWARD ACCEPT [0:0]
View debian8_9_10_bower_install.sh
apt-get update && apt-get -y install software-properties-common
curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt-get -y install nodejs && npm install -g bower
which bower && bower -v
@AysadKozanoglu
AysadKozanoglu / RocketChat_Jira_webhook_Integration.md
Last active Sep 10, 2019
RocketChat Jira webhook Integration
View RocketChat_Jira_webhook_Integration.md

notify on issue creation, deletion and status, resolution, comment or priority changes.

  1. In Rocket.Chat go to “Administration”->”Integrations” and create “New Integration”
  2. Choose Incoming WebHook
  3. Follow all instructions like Enable, give it a name, link to channel etc. Set “Enable Script” to true and enter content of this script in the “Script” box
  4. Press Save changes and copy the Webhook URL (added just below the script box)
  5. Go to your jira as administrator and follow instructions on adding outgoing webhook here

You can tweak the content of the script to better suit your needs Add Jira integration via Outgoing WebHook

@AysadKozanoglu
AysadKozanoglu / wp.config.php
Created May 30, 2019
Disable admin-ajax on the front-end of WordPress sites and cache the resulting 404.
View wp.config.php
<?php
if(
strpos( $_SERVER['HTTP_REFERER'], 'wp-admin' ) === false &&
strpos( $_SERVER['REQUEST_URI'], 'admin-ajax.php' ) !== false
) {
header( 'Cache-Control: max-age=30000, must-revalidate' );
header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', strtotime( '+5000 minutes' ) ) . ' GMT' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s', strtotime( '-5000 minutes' ) ) . ' GMT' );
header( $_SERVER["SERVER_PROTOCOL"]." 404 Not Found" );
die;
@AysadKozanoglu
AysadKozanoglu / debian-install-megacli.md
Created May 28, 2019 — forked from fxkraus/debian-install-megacli.md
Install LSI MegaCli .deb package on Debian/Ubuntu
View debian-install-megacli.md

download

wget https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/8-07-14_MegaCLI.zip

unzip

unzip 8-07-14_MegaCLI.zip
View canlitv.com_getStreamAndRestream
streamPath="/usr/local/nginx/html/stream"; link=$(wget -qO tv8.html https://canlitv.com/canli-tv8-5 | cat tv8.html | grep file | cut -d \" -f2); rm -rf $streamPath/* && ffmpeg -y -probesize 15000000 -analyzeduration 12000000 -i "$link" -user_agent "firefox browser" -strict -2 -dn -acodec copy -vcodec copy -crf 29 -hls_flags delete_segments -hls_time 10 -hls_list_size 8 -hls_segment_filename "$streamPath/tv8%d.ts" $streamPath/tv8.m3u8
View bashrc
# Shorten home dir, cygwin drives, paths that are too long
# (just bourne; no perl, sed, or bashisms!)
HOST='\033[02;36m\]\h'; HOST=' '$HOST
TIME='\033[01;31m\]\t \033[01;32m\]'
LOCATION=' \033[01;34m\]`pwd | sed "s#\(/[^/]\{1,\}/[^/]\{1,\}/[^/]\{1,\}/\).*\(/[^/]\{1,\}/[^/]\{1,\}\)/\{0,1\}#\1_\2#g"`'
BRANCH=' \033[00;33m\]$(git_branch)\[\033[00m\]\n\$ '
PS1=$TIME$USER$HOST$LOCATION$BRANCH
PS2='\[\033[01;36m\]>'
You can’t perform that action at this time.