Skip to content

Instantly share code, notes, and snippets.

View aidnurs's full-sized avatar

Nursultan aidnurs

View GitHub Profile
@aidnurs
aidnurs / nested_ssh_paramiko_pysftp.py
Created June 4, 2023 14:56
Nested SSH using Python Paramiko and pysftp
import pysftp
import paramiko
# SSH jump server details
jump_server_host = '<host>'
jump_server_username = '<user>'
jump_server_password = '<password>'
# SFTP server details
sftp_server_host = '<host>'
@aidnurs
aidnurs / nested_ssh.py
Created June 4, 2023 14:54
Nested SSH using Python Paramiko
import paramiko
# SSH jump server details
jump_server_host = '<host>'
jump_server_username = '<user>'
jump_server_password = '<password>'
# SFTP server details
sftp_server_host = '<host>'
sftp_server_username = '<user>'
@aidnurs
aidnurs / list_changed_dirs.sh
Created February 14, 2022 20:39
List changed git directories
git diff --name-only --cached | xargs -L1 dirname | cut -d '/' -f-2 | uniq | grep "/."
@aidnurs
aidnurs / expire_user.php
Created June 1, 2020 11:07
Wordpress custom hook to change user role after expiration date
function change_expired_users_role()
{
$args = array(
'role' => 'member_trial',
);
$users = get_users($args);
if (empty($users))
return;
@aidnurs
aidnurs / docker-compose.yml
Created May 31, 2020 15:43
Docker-compose for Wordpress+MariaDB
version: '3.5'
services:
db:
container_name: db
image: mariadb:latest
volumes:
- ./run/var:/var/lib/mysql
- ./run/dump/:/docker-entrypoint-initdb.d/ # mount initial sql dump to container
restart: always
{
"arrowParens": "always",
"bracketSpacing": true,
"printWidth": 100,
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "all"
}