Skip to content

Instantly share code, notes, and snippets.

View solicomo's full-sized avatar

Soli Como solicomo

View GitHub Profile
@solicomo
solicomo / .minttyrc
Created March 8, 2024 15:01
Git-Bash Colors/Theme
Font=DejaVu Sans Mono
FontHeight=12
Columns=256
Rows=80
ScrollbackLines=102400000
ClipShortcuts=yes
RightClickAction=paste
Term=xterm-256color
Answerback=xterm-256color
OpaqueWhenFocused=yes
@solicomo
solicomo / myip
Last active November 5, 2023 20:11
myip
#!/bin/sh
curl -s https://1.1.1.1/cdn-cgi/trace | grep "ip=" | cut -d= -f 2
@solicomo
solicomo / donate-buttons.htm
Created April 26, 2013 16:53
精简过的PayPal捐赠按钮和OKPay捐赠按钮。前者是基于“立即购买”按钮修改的,因为中国的PayPal账户不能接收捐赠。
<center>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="soli@cbug.org">
<input type="hidden" name="item_name" value="Support cbug.org">
<input type="hidden" name="amount" value="">
<input type="hidden" name="currency_code" value="USD">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" style="border:0px;background:none;" name="submit" alt="PayPal - The safer, easier way to pay online">
</form>
</center>
@solicomo
solicomo / read-excel-using-csharp.cs
Created October 28, 2014 01:47
Read Excel Using C#
using System;
using System.Windows.Forms;
using Excel = Microsoft.Office.Interop.Excel;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
@solicomo
solicomo / solarized_for_xshell.xcs
Last active February 11, 2022 18:27
Solarized Light/Dark Theme of XShell
[Names]
count=2
name1=Solarized Dark
name0=Solarized Light
[Solarized Light]
text(bold)=586e75
magenta(bold)=6c71c4
text=657b83
white(bold)=fdf6e3
green=859900
@solicomo
solicomo / disable-power-save.md
Created January 27, 2019 00:15
[Pi 3B+] disable power save on CentOS 7
# yum install -y iw
# iw dev wlan0 set power-save off
@solicomo
solicomo / cf_ddns.py
Created January 14, 2019 04:16
CloudFlare Dynamic DNS
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
import sys
import requests
import json
from datetime import datetime
EMAIL='Your Email'
APIKEY='Your API Key from CloudFlare'
@solicomo
solicomo / X-Apple-I-FD-Client-Info.js
Created March 16, 2018 04:14 — forked from borgle/X-Apple-I-FD-Client-Info.js
在访问 https://appleid.apple.com/account?&localang=CN-ZH 这个页面的时候,页面会ajax一个特殊的header请求,其中的X-Apple-I-FD-Client-Info信息是一个json对象,本gist是整理后的F值获取方式源码。
(function(m) {
function g(e) {
try {
if (navigator.plugins && navigator.plugins.length)
for (var t = 0; t < navigator.plugins.length; t++) {
var n = navigator.plugins[t];
if (n.name.indexOf(e) >= 0)
return n.name + (n.description ? "|" + n.description : "")
}
} catch (r) {}
@solicomo
solicomo / files_in.php
Last active December 8, 2016 09:02
[PHP] get all files in a path
<?php
function files_in($path, $types = 'f', $recursive = false)
{
$files = array();
//$path = realpath($path);
$dirs = new RecursiveDirectoryIterator($path);
$dirs->setFlags($dirs->getFlags() | FilesystemIterator::SKIP_DOTS);
#include <event.h>
#include <evhttp.h>
#include <pthread.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <iostream>