Skip to content

Instantly share code, notes, and snippets.

@ifduyue
ifduyue / -.md
Last active August 19, 2023 00:17
Resolve pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (openssl)
# yum
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (openssl)

Please install a package which provides this module, or
verify that the module is installed correctly.
@ifduyue
ifduyue / beanstalkd.service
Last active March 1, 2023 11:36
Install beanstalkd on CentOS 7 / CentOS 8
[Unit]
Description=Beanstalkd is a simple, fast work queue
[Service]
User=nobody
Restart=always
RestartSec=500ms
ExecStart=/usr/local/bin/beanstalkd -b /var/lib/beanstalkd
LimitNOFILE=10240
@ifduyue
ifduyue / perl-one-liners.bash
Last active November 9, 2021 01:13
My Perl one liner collections
# Check if FILES contain lines ending with whitespaces
perl -Mopen=IO,:raw -ne 'print "$ARGV $.\n" if /\s\R/; $.=0 if eof;' FILES
# shuffle lines
perl -MList::Util=shuffle -e 'print shuffle <>'
# random string
perl -le 'print map chr 33 + rand 94, 1..pop||20' 50
@ifduyue
ifduyue / install-proxychains-ng.sh
Last active November 5, 2021 06:50
Install proxychains-ng on CentOS
#!/bin/sh
# Usage:
# wget -O- https://gist.githubusercontent.com/ifduyue/dea03b4e139c5758ca114770027cf65c/raw/install-proxychains-ng.sh | sudo bash -s
set -eu
version=4.14
wget https://github.com/rofl0r/proxychains-ng/archive/v$version.tar.gz
tar xf v$version.tar.gz
@ifduyue
ifduyue / add-git-aliases.sh
Last active October 11, 2021 02:31
git aliases
#!/bin/bash
set -x
# common shortcuts
git config --global alias.co checkout
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.br branch
git config --global alias.rb rebase
#!/usr/bin/env python
#coding: utf8
#
#
# xml2dict
# ============
#
# Convert XML to dict.
#
@ifduyue
ifduyue / changelog.txt
Last active February 26, 2020 08:18
The goods from okean.com
2020.02.19 1600 UTC
china
added: 103.148.174.0/23
2020.01.21 1702 UTC
china
added: 103.147.211.0/24
@ifduyue
ifduyue / build.sh
Last active February 26, 2020 08:17
firefox-no-proxy-for-china
#!/bin/bash
awk '!/^($|#)/' no-proxy.txt | tee no-proxy-generated.txt
@ifduyue
ifduyue / apt install docker-engine
Created October 14, 2015 09:08
Can't install docker-engine on Ubuntu 14.04 LTS
# apt-get install -f docker-engine
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
#!/usr/bin/env perl
use strict;
use warnings;
use Getopt::Long 2.24 qw( :config bundling no_ignore_case no_auto_abbrev );
my ( $N, $EXT, @EXT, @USE, $DECODE, $ENCODE );
sub compile { eval shift } # defined early to control the lexical environment
my $msglevel = 0;