- Download Fedora 26 iso, create a usb bootable media
- Use
diskutil listto figure out which drive is the usb, on macbook pro with 1 hardrive, the usb is/dev/disk2 - Umount the disk using
diskutil unmountDisk /dev/disk2or use Mac's Disk Utility (just umount, don't eject, umount removes it from directory structure and eject disconncet it altogether) - Use
dd(a low levelcp) to write iso content into the usb drive,sudo dd if=~/Downloads/Fedora-Live-Desktop-x86_64-20-1.iso of=/dev/rdisk2 bs=8m, this will take a bit of time, make sure you wait until it's done, additionally compare the size or checksum to make sure all has been copied (not that necessary since if it weren't copied, it'll err at boot time) - Use Disk Utility to shrink Mac's harddrive to create partition for the subsequent fedora installation
- Boot to recovery mode (cmd+r) and disable SIP (termina
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local bufname = "SingleTerminal" | |
| -- Define term position and size | |
| local splitconfig = "bot 20 new " | |
| local jobid = -1 | |
| local bufid = -1 | |
| local terminal_opened_win_id = -1 | |
| local function showTerm(wind_id) | |
| terminal_opened_win_id = wind_id | |
| vim.cmd(splitconfig .. "| buffer " .. bufname) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Use tcpdump to monitor mysql | |
| # Capture the packets | |
| sudo tcpdump -i eth0 port 3306 -s 65535 -x -n -q -tttt > tcpdump.out | |
| # analyze all the requests from a given host | |
| pt-query-digest --type=tcpdump --filter '($event->{host} || $event->{ip} || "") =~ m/192.168.248.64/' tcpdump.out | |
| # 直接使用 tcpdump 打印相关SQL文本 | |
| sudo tcpdump -i any -nn -s 0 -l -w - host 192.168.56.102 and tcp port 3306 | strings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python3 | |
| import asyncio | |
| import time | |
| import socket | |
| import argparse | |
| import aiohttp | |
| class MyConnector(aiohttp.TCPConnector): |
Configured for a Mac-like experience
Apple Magic Keyboard 2: Model A1644 (same as MLA22LL/A ?)
Mapping for Linux Mint 18 Cinnamon 64-bit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/sh | |
| # update glibc to 2.17 for CentOS 6 | |
| wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-2.17-55.el6.x86_64.rpm | |
| wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-common-2.17-55.el6.x86_64.rpm | |
| wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-devel-2.17-55.el6.x86_64.rpm | |
| wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-headers-2.17-55.el6.x86_64.rpm | |
| sudo rpm -Uvh glibc-2.17-55.el6.x86_64.rpm \ |
Vim is an advanced CLI based text editor. Many key combinations used in Vim are easily associated with a memorable phrase. One effective way to use Vim is to associate phrases with Operators, Text Objects and Motions. Then compose a phrase for what you want to do. Start with an Operator followed by a Text Object or Motion. Prefix an Operator, Command or Motion with a number/count to extend it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # update_gfwlist.sh | |
| # Author : VincentSit | |
| # Copyright (c) http://xuexuefeng.com | |
| # | |
| # Example usage | |
| # | |
| # ./whatever-you-name-this.sh | |
| # | |
| # Task Scheduling (Optional) |
- Use
curlto get the JSON response for the latest release - Use
grepto find the line containing file URL - Use
cutandtrto extract the URL - Use
wgetto download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \NewerOlder