Skip to content

Instantly share code, notes, and snippets.

View lijunle's full-sized avatar

Junle Li lijunle

View GitHub Profile
@thesamesam
thesamesam / xz-backdoor.md
Last active May 22, 2024 14:41
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

@imthenachoman
imthenachoman / 00 README.md
Last active May 16, 2024 20:13
Debian snapper apt script to include full apt command including arguments as snapshot description

This gist includes an enhancement to Debian's snapper package.

The current (as of 2023-07-23) snapper package includes an apt configuration that will automatically take snapper snapshots when you use apt to install/remove/etc. It will add use "apt" as the description of the pre/post snapshot.

With the below changes to the /etc/apt/apt.conf.d/80snapper file and associated dpkg-pre-post-snapper.sh file, snapper will include the full apt command, including the arguments, in the snapshot description.

For example:

$ sudo apt install funky
@stokito
stokito / howto_webdav_lighttpd_openwrt.md
Last active October 22, 2023 11:46
WebDAV with Lighttpd on OpenWRT
@zjx20
zjx20 / gist:1c7f4dd1392866f9d8b00dd2a05bd481
Last active February 2, 2024 19:07
kcptun install and systemd daemon
wget https://github.com/xtaci/kcptun/releases/download/v20170525/kcptun-linux-amd64-20170525.tar.gz
tar xvf kcptun-linux-amd64-20170525.tar.gz
sudo mv server_linux_amd64 /usr/local/bin/kcptun_server
sudo mv client_linux_amd64 /usr/local/bin/kcptun_client
sudo mkdir -p /etc/kcptun
sudo bash -c "cat <<EOT > /etc/kcptun/server_conf.json
{
\"listen\": \":4321\",
\"target\": \"127.0.0.1:8421\",
@jangnezda
jangnezda / main.js
Created October 12, 2016 11:44
How to load an external URL in <iframe> using Electron
/*
* By default, Electron (well, underlying Chrome browser) will reject loading external URLs
* to an <iframe>. To circumvent this limitation, we can manipulate response headers from any
* http request and feed them to the Electron window.
*
* The 'onHeadersReceived' listener is documented here:
* http://electron.atom.io/docs/api/session/#webrequestonheadersreceivedfilter-listener
*/
app.on('ready', () => {
@lijunle
lijunle / .gitconfig
Last active September 16, 2023 05:36
Various Configs
[user]
name = Junle Li
email = lijunle@gmail.com
[core]
excludesfile = ~/.gitignore
pager = cat
[gc]
auto = 0
[alias]
br = branch -v
@Tenzer
Tenzer / 000-README.md
Last active December 11, 2020 10:19
Cask upgrade

Cask-Upgrade

Small utility to help you manage packages installed via Homebrew Cask as it currently can't upgrade installed packages for you or clean up old versions.

The script will ask you if you want to upgrade applications which has newer versions available. Downloads from previous versions of applications will be removed when an application is updated, like what Homebrew has been doing since version 2.0.0. This behaviour can be disabled by setting the environment variable HOMEBREW_NO_INSTALL_CLEANUP.

Installation

@j-iNFINITE
j-iNFINITE / 百度云盘批量转存用户分享
Created February 29, 2016 06:00
百度云盘批量转存用户分享
/**
* 贪灵Gollum for Baiduyun, Ver.3.4.4
* 立即执行函数:百度云盘批量转存用户分享。
*
* 【特点】
* - 可保持或无视原分享者的目录结构。
* - 支持差分转存。
* - 自动分解转存,可突破单次转存总文件数5000的限制。
* - 可在分享主页下,进入某文件夹来转存其下级子文件夹。
* - 支持专辑转存。
@paulirish
paulirish / what-forces-layout.md
Last active May 21, 2024 09:11
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@lijunle
lijunle / TFS_Without_VS.md
Last active August 10, 2021 18:29
TFS Build Web Application Without Visual Studio

Steps

  1. Copy C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\{Web,WebApplications} folders to build server
  2. Update NuGet to newest version by running C:\Program Files\Microsoft Team Foundation Server 12.0\Tools\nuget.exe update -self
  3. Install .Net Framework 3.5 Runtime from server manager
  4. Install .Net Framework 4.5 Targeting Pack via install from Windows 8 SDK
    • Note 1: DONOT install Windows 8.1 version, which includes .Net Framework 4.5.1 SDK
    • Note 2: You can only download and install .Net Framework 4.5 SDK
  • Note 3: After install .Net Framework SDK, you can uninstall Windows SDK from control panel