Skip to content

Instantly share code, notes, and snippets.

View banochkin's full-sized avatar
:octocat:
banochkin.com

banochkin.com DAO banochkin

:octocat:
banochkin.com
View GitHub Profile
@tushroy
tushroy / proxmox-realtek-r8168.md
Last active July 25, 2025 18:34
Realtek r8168 Driver for Proxmox VE Kernel version 6.8

Realtek r8168 Driver for Proxmox VE Kernel version 6.8

Blacklist r8169 kernel driver for being loaded

echo blacklist r8169 >> /etc/modprobe.d/blacklist-r8169.conf

Once all of this is completed we are going to update our GRUB to have some specific kernel parameters for our realtek driver

@mohit0749
mohit0749 / GooglePhotosTakeoutHelper.py
Last active April 15, 2025 07:54
GooglePhotosTakeoutHelper
directory = '/path/to/photos'
output_directory = '/path/to/output_directory'
bin_directory = '/path/to/trash_directory'
import json
import os
import shutil
from datetime import datetime
@SQLJames
SQLJames / proxmox-realtek.md
Last active July 25, 2025 18:41
proxmox realtek driver issues

Edit 2

Here are the steps I took to upgrade my nodes when the time came. Make sure that your apt upgrade and apt dist-upgrade don't have any errors.

Additionally, on one of my nodes, I had to confirm the grub install location. So It may be good to do this prior to upgrading by confirming the mount point of your boot disk.

apt remove --purge r8168-dkms -y
rm /etc/modprobe.d/blacklist-r8169.conf
sudo sed -i 's/GRUB_CMDLINE_LINUX="r8168.aspm=0 r8168.eee_enable=0 pcie_aspm=off loglevel=3"/GRUB_CMDLINE_LINUX=""/' /etc/default/grub
update-grub
@tomdaley92
tomdaley92 / README.md
Last active July 27, 2025 01:03
Proxmox - SPICE Client setup for MacOS

Proxmox - SPICE client setup for MacOS

  1. Install a working (and compiled) version of virt-viewer. You may view the homebrew package's upstream source on GitHub.

    brew tap jeffreywildman/homebrew-virt-manager
    brew install virt-viewer
  2. Once that's installed should be able make a call remote-viewer with a pve-spice.vv file downloaded from proxmox web interface

@premek
premek / mv.sh
Last active March 5, 2024 17:43
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
#
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)
@lord-alfred
lord-alfred / keitaro_api_example.php
Last active November 30, 2024 10:15
Запрос к API Keitaro TDS v6 с запасным URL, в случае если TDS недоступна (позволяет не терять трафик)
<?php
// пример работы с Keitaro TDS v6 по API (написан на PHP 7 (!) из-за Throwable)
// запрет кэширования этой страницы в CloudFlare/браузере
header("Cache-Control: private");
// сюда можно воткнуть какой-то свой антибот, чтоб он отрабатывал до запуска общения с API
// примерно как-то так:
// require_once(__DIR__ . '/antibot.php');
@mtx-z
mtx-z / wp-bootstrap4.4-pagination.php
Last active January 16, 2025 16:15
Wordpress 5.4 Bootstrap 4.4 pagination (with custom WP_Query() and global $wp_query support) (UPDATED for Bootstrap 5: https://gist.github.com/mtx-z/af85d3abd4c19a84a9713e69956e1507)
<?php
/**
* @param WP_Query|null $wp_query
* @param bool $echo
* @param array $params
*
* @return string|null
*
* UPDATE for Bootstrap 5.0: https://gist.github.com/mtx-z/af85d3abd4c19a84a9713e69956e1507
*
@campusboy87
campusboy87 / setup_404_for_url_with_space.php
Last active October 17, 2017 10:26
Для страниц, которые имею пробел в ссылке, устанавливает ответ сервера 404.
<?php
add_action( 'pre_handle_404', function ( $false, $wp_query ) {
// если ярлык страницы содержит пробел...
$url = empty( $wp_query->query['pagename'] ) ? '' : $wp_query->query['pagename'];
if ( $url && strpos( $url, '%20' ) !== false ) {
$wp_query->set_404();
status_header( 404 );
nocache_headers();
@campusboy87
campusboy87 / insert_parse_post.php
Created October 8, 2017 14:32
Публикует спаршенную запись c проверкой, есть ли подобная запись в БД по уникальному ключу
<?php
/**
* Проверяет наличие метаполя поста с заданным занчением
*
* @param string $url уникальное значение для поста, к примеру путь будет url спаршенной статьи
*
* @return bool
*/
function is_unique_meta_parse_post( $url ) {