Skip to content

Instantly share code, notes, and snippets.

Avatar

ibegyourpardon ibegyourpardon

  • Shanghai
View GitHub Profile
@ibegyourpardon
ibegyourpardon / reporter.sh
Created Feb 1, 2021 — forked from archichen/reporter.sh
一行命令生成所有占用端口及其进程报告|Generate a report for all occupied port and their program with a line command
View reporter.sh
# Choose one command, Copy it and execute, no need for execute reporter.sh file.
# Report file was place at /tmp/reporter.csv|md
# CSV version
# Preview: https://imgur.com/c5E0T1v
netstat -ntlp | awk 'BEGIN{ system("echo IP, Port, PID, Parameter > /tmp/reporter.csv") } NR>2 {if($4 !~ "::" && $7 != "-"){split($4,ipAndPort,":"); split($7,pidAndProgress,"/"); system("echo "ipAndPort[1]","ipAndPort[2]","pidAndProgress[1]", `cat /proc/"pidAndProgress[1]"/cmdline` >> /tmp/reporter.csv")}}'
# Markdown version
# Preview: https://imgur.com/ivmUhgu
netstat -ntlp | awk 'BEGIN{ system("echo \\|IP\\|Port\\|PID\\|Parameter\\| > /tmp/reporter.md; echo \\|-\\|-\\|-\\|-\\| >> /tmp/reporter.md") } NR>2 {if($4 !~ "::" && $7 != "-"){split($4,ipAndPort,":"); split($7,pidAndProgress,"/"); system("echo \\|"ipAndPort[1]"\\|"ipAndPort[2]"\\|"pidAndProgress[1]"\\|`cat /proc/"pidAndProgress[1]"/cmdline`\\| >> /tmp/reporter.md")}}'
@ibegyourpardon
ibegyourpardon / fix-wordpress-https-301.php
Created Jul 6, 2020
WordPress启用https后首页无限301跳转问题的解
View fix-wordpress-https-301.php
// 添加在wp-config.php的文件开头
$_SERVER['HTTPS'] = 'on';
define('FORCE_SSL_LOGIN', true);
define('FORCE_SSL_ADMIN', true);
View bbc-13-minutes-to-the-moon.markdown
@ibegyourpardon
ibegyourpardon / index.html
Created Mar 17, 2020
Pure CSS Landscape - An Evening in Southwold
View index.html
<landscape>
<sky>
<x>
<x></x>
<x></x>
<x></x>
</x>
<x>
<x></x>
<x></x>
View gist:6f5aed62e81d311370d0e297697857b3
/**
* 获取推流地址
* 如果不传key和过期时间,将返回不含防盗链的url
* @param domain 您用来推流的域名
* streamName 您用来区别不同推流地址的唯一流名称
* key 安全密钥
* time 过期时间 sample 2016-11-12 12:00:00
* @return String url
*/
@ibegyourpardon
ibegyourpardon / install.sh
Created Jul 30, 2019
install jenkins by yum on centos 7
View install.sh
#!/bin/bash
#Jenkins is a Java application, so the first step is to install Java. Run the following command to install the OpenJDK 8 package:
sudo yum install java-1.8.0-openjdk-devel
#The next step is to enable the Jenkins repository. To do that, import the GPG key using the following curl command:
curl --silent --location http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo | sudo tee /etc/yum.repos.d/jenkins.repo
#And add the repository to your system with:
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
#sudo yum install jenkins
sudo yum install jenkins
View press.one
https://press.one/p/address/v?s=49bca4a86f2aee5d7ba3c0bf4f5f8e12a23e34db6c5bba9f960a3cfc9696bc4aa6224540f6b6dcec73d514fc3bbace73cf0c5dbd6bd4e954287c8a049a636fd00&h=4c3a3a251e2d22ba49efbafd3cae14d35aea925ccdf4d9b6fe4c331f7d4637ec&a=96a691401ac07772f32dd43fe0c6fcda97a13df1&f=P1&v=2
@ibegyourpardon
ibegyourpardon / gist:8a493b42bb97df72b227cc46cbc1807b
Last active Jan 28, 2018
set static ip address for ubuntu 16.04
View gist:8a493b42bb97df72b227cc46cbc1807b
auto enp7s0
iface enp7s0 inet static
address 10.0.208.222
netmask 255.255.240.0
gateway 10.0.208.1
dns-nameservers 10.0.208.1
#enp7s0 = name
#给 Ubuntu 16.04 系统设置静态 IP 地址
View gist:30b7b45dced948384cc64f3929917c46
#114dns
114.114.114.114
114.114.115.115
#alibaba.public.dns
223.5.5.5
223.6.6.6
#baidu.public.dns
180.76.76.76
#dnspod.tencent.public.dns
119.29.29.29
View Block Baidu Hosts
##
# Block Baidu
##
127.0.0.1 baidu.com
127.0.0.1 www.baidu.com
127.0.0.1 pan.baidu.com
127.0.0.1 post-js.baidu.com
127.0.0.1 bbs.baidu.com
127.0.0.1 tieba.baidu.com
127.0.0.1 wapp.baidu.com