Skip to content

Instantly share code, notes, and snippets.

@AntonOrlov
AntonOrlov / install.sh
Last active July 5, 2023 10:29
3proxy installation script for CentOS 7.2.1511
yum install 3proxy;
curl https://gist.githubusercontent.com/AntonOrlov/a70aeed276d35dc9d77060b0a6c167ed/raw -o /etc/3proxy.cfg;
chmod 644 /etc/3proxy.cfg;
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --zone=public --add-port=9000/tcp --permanent
systemctl enable 3proxy.service;
systemctl restart 3proxy.service;
@williamgomes
williamgomes / config
Last active June 30, 2023 12:20
Nginx Config for Wordpress
###########
paste this inside virtual host file /etc/nginx/sites-available/<YOUR CONFIG FILE>
###########
server {
listen 80;
server_name <DOMAIN_OR_HOST_NAME>;
root /var/www/html/<FOLDER_NAME>;
@TomasKulhanek
TomasKulhanek / pythonwebdesktop.py
Last active January 11, 2022 05:22
Desktop background (linux,windows) as web page using python, webkit and proxy settings
#!/usr/bin/env python
# desktop background as web page using webkit and proxy settings
# https://kmandla.wordpress.com/2010/05/24/the-1-2kb-python-browser-script/
# - proxy support is included in webkit no need of -- http://stackoverflow.com/questions/6915840/python-webkit-with-proxy-support
# http://superuser.com/questions/419195/set-an-html-page-as-the-wallpaper-on-linux
import sys
import gtk
import webkit
import webbrowser
@harv
harv / glibc-2.17_centos6.sh
Last active March 1, 2024 08:42
update glibc to 2.17 for CentOS 6
#! /bin/sh
# update glibc to 2.17 for CentOS 6
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-common-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-devel-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-headers-2.17-55.el6.x86_64.rpm
sudo rpm -Uvh glibc-2.17-55.el6.x86_64.rpm \
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Python Spintax parser
This module provides an efficient spintax parser where every possible spuns have the same probability.
Given a masterspin you can get the total number of possible spuns or a randomly chosen spun.
"""
@kurlov
kurlov / mkv embed soft subtitles
Created December 16, 2017 23:41
ffmpeg command to add .srt based subtitles to an .mkv file
ffmpeg -i in.mkv -f srt -i in.srt -map 0:0 -map 0:1 -map 1:0 -c:v copy -c:a copy -c:s srt out.mkv
@lynt-smitka
lynt-smitka / fbclid-nginx.conf
Last active March 13, 2024 18:56
Remove fbclid argument from the URL in Nginx
http {
...
# redirect map in http block - remove fbclid argument from the end
map $request_uri $redirect_fbclid {
"~^(.*?)([?&]fbclid=[a-zA-Z0-9_-]+)$" $1;
}
...
@lynt-smitka
lynt-smitka / fbclid.htaccess
Last active November 6, 2023 13:10
Remove fbclid argument from the URL in .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.*?)(&?fbclid=[a-zA-Z0-9_-]+)$
RewriteRule ^(.*)$ /$1?%1 [L,NE,R=301]
</IfModule>
@dlqqq
dlqqq / ryzen_bug.md
Last active February 22, 2024 22:22 — forked from wmealing/C-states.md
AMD Ryzen "Freezing" Bug on GNU/Linux Systems

Random "Freezing" with AMD Ryzen CPUs

It seems that numerous GNU/Linux users (including myself) have been having issues with the system randomly "freezing" during light usage. From journalctl output and anecdotal accounts, it is speculated that the AMD Ryzen CPUs do not support other C-states for power management very well (at least on GNU/Linux distributions), and the freezing may be resolved by limiting the C-state of the CPU.

Possible Solution

Limiting the C-state of the CPU can be done through the addition of the following kernel boot parameter.

processor.max_cstate=1
@yunqu
yunqu / dropbox.md
Created January 7, 2020 21:01
Download a File from Dropbox in Linux

Download a File from Dropbox in Linux

To download a file from dropbox, the following steps have to be followed:

  1. In your dropbox folder, click the file you want to share, and then click share; and then click create link.
  2. Once the link has been created, you can copy the link by copy link. This will copy the link into your clipboard.
  3. You can paste it somewhere. It has a format similar to: https://www.dropbox.com/s/m5ay6j4to7ryr4p/resizer.bit?dl=0