Skip to content

Instantly share code, notes, and snippets.

View knktc's full-sized avatar

knktc knktc

View GitHub Profile
@knktc
knktc / baidu_submit.py
Last active February 28, 2022 04:44
用于自动向百度提交url的脚本,将会从sitemap中解析url,然后向百度进行提交
#!/usr/bin/env python3
"""
向百度提交sitemap的脚本
详细使用方法请参考: https://knktc.com/2022/02/27/submit-baidu-sitemap-by-github-actions/
@author:knktc
@contact:me@knktc.com
@create:2022-02-12 22:49
@knktc
knktc / bulk_disable_confluence_users.py
Created February 16, 2021 02:08
A simple script to Bulk disable Confluence users with Selenium. Tested with Confluence 7.11.0 and Chrome 88.
#!/usr/bin/env python3
"""
A simple script to Bulk disable Confluence users with Selenium
Tested with Confluence 7.11.0 and Chrome 88
@author:knktc
@contact:me@knktc.com
@create:2021-02-16 09:12
"""
@knktc
knktc / run_script.py
Created October 1, 2020 03:08
A Django custom command, to run script in current project environment.
"""
@author:knktc
@contact:me@knktc.com
"""
import os
import sys
import argparse
from django.core.management.base import BaseCommand
@knktc
knktc / code_lines_counter.py
Created April 22, 2018 11:07
code lines counter written in python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# generate code details with path and code lines count
# usage: python code_lines_counter.py FULL_PATH_TO_YOUR_CODE
"""
@author:knktc
@contact:me@knktc.com
@create:2018-04-22 18:00
"""
@knktc
knktc / provision.sh
Created August 29, 2014 02:03
installation scripts for redash 0.4
#!/bin/bash
REDASH_TARBALL=/tmp/redash.0.4.0.b522.tar.gz
VERSION_DIR=/opt/redash/redash.0.4.0.b522.tar.gz
REDASH_BASE_PATH=/opt/redash
sudo apt-get update
sudo apt-get install -y python-pip redis-server postgresql postgresql-server-dev-9.3 python-dev nginx curl
wget https://github.com/EverythingMe/redash/releases/download/v0.4.0%2Bb522/redash.0.4.0.b522.tar.gz -O $REDASH_TARBALL
sudo adduser --system --no-create-home --disabled-login --gecos "" redash
@knktc
knktc / redash_updater.conf
Created August 29, 2014 02:01
redash updater start script for 0.4
description "re:dash updater"
chdir /opt/redash/current
setuid redash
kill signal TERM
respawn
respawn limit 10 5
start on started network-services