Skip to content

Instantly share code, notes, and snippets.

@anhhtz
anhhtz / rsync.md
Last active February 2, 2021 04:11
Giới thiệu lệnh rsync bá đạo trên Linux/macOS

Giới thiệu lệnh rsync bá đạo trên Linux/macOS

Đối với những anh em hay copy/move một lượng dữ liệu lớn (vài ngàn đến vài trăm ngàn tập tin) trên macOS nếu dùng Finder sẽ rất lâu và hay xảy ra lỗi, phần merge folder/file của macOS cũng không thực sự tốt. macOS có một lệnh command-line (terminal) cực kỳ bá đạo cho công việc này đó là rsync. rsync không đơn giản copy/move nó còn gồm cả sync cực kỳ nhanh và chuẩn xác. Cá nhân mình từng tìm kiếm rất nhiều phần mềm hỗ trợ việc copy/move/sync folder/file như GoodSync, FolderSync, Beyond Compare,... nhưng rốt cuộc rsync vẫn là số 1. Nó có thể xử lý lượng liệu vài TB cho đến hàng trăm ngàn files lúc nhúc như kiến cỏ. Điểm bá đạo ở rsync là nó "nhớ" được tiến trình đã thực hiện trước đó và dễ dàng cho bạn resume quá trình mà không phải thực hiện lại từ đầu. Điều này rất tiện khi đang sync vài trăm ngàn files mà phải ngưng lại rồi sau này thực hiện tiếp tục.

@anhhtz
anhhtz / README.md
Last active June 4, 2019 06:23
Fixes bluetooth "freeze" after wake up from sleeping

Fixes bluetooth "freeze" after wake up from sleeping

How to use

Setup

  • Save/clone the script rs_bluetooth.sh. Example at /Users/davidbob/rs_bluetooth.sh. davidbob is your username.
  • Open Terminal app. Type command:

(sudo) chmod +x /Users/davidbob/rs_bluethooth.sh

@anhhtz
anhhtz / restart_bluetooth.sh
Created May 14, 2019 14:10 — forked from nicolasembleton/restart_bluetooth.sh
Restart Bluetooth Daemon on Mac OS X without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@anhhtz
anhhtz / Ubiquiti UniFi SSH Commands.md
Last active March 15, 2023 16:46
Ubiquiti UniFi SSH Commands

Ubiquiti UniFi SSH Commands:

Login

root / ubnt or ubnt / ubnt

Reboot

Reboot

Reset AP to Factory Default

syswrapper.sh restore-default

@anhhtz
anhhtz / ServiceAPI+Endpoint.swift
Created December 16, 2017 22:57
Define api request by enum in swift
//
// ServicesAPI+WebServices.swift
// gist
//
// Created by Allan Vialatte on 28/07/16.
// Copyright © 2016 Allan Vialatte. All rights reserved.
//
//MARK: - WebServices
extension ServicesAPI {
@anhhtz
anhhtz / gist:59f8dfda161664effed4fb129b503571
Created May 16, 2017 12:59 — forked from jnhuynh/gist:86693d8b485f4d335300
React Native Directory Structure
.
├── index.ios.js
├── js
│   ├── actions
│   │   ├── ChatServerActionCreators.js
│   │   └── ChatThreadActionCreators.js
│   ├── components
│   │   ├── ChatScreen
│   │   │   ├── index.js
@anhhtz
anhhtz / agribank-atm-v2
Last active November 19, 2016 22:22
agribank-atm-v2
{
"app": "Agribank ATM 2",
"api_url": "https://parse.buddy.com/parse",
"cfg_url_1": "https://appoda.com/cfq/agribank-atm-v2.json",
"cfg_url_2": "https://vietcoding.com/cfq/agribank-atm-v2.json",
"cfg_url_3": "https://gist.githubusercontent.com/HTAD/95790a04a4510cd9638c53fd146f1f30/raw/7a5bdded463ee74bb8b501a4781e71804976ee55/agribank-atm-v2"
}