Skip to content

Instantly share code, notes, and snippets.

View ductrung-nguyen's full-sized avatar

Duc Trung NGUYEN ductrung-nguyen

View GitHub Profile
@dannote
dannote / final-cut-pro-trial-reset.swift
Last active May 8, 2024 03:08
Final Cut Pro X trial reset
#!/usr/bin/swift
import Foundation
let path = URL(fileURLWithPath: NSString(string: "~/Library/Application Support/.ffuserdata").expandingTildeInPath)
let data = try! NSData(contentsOf: path) as Data
let dictionary = try! NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(data) as! NSDictionary
let mutableDictionary = dictionary.mutableCopy() as! NSMutableDictionary
for (key, value) in mutableDictionary {
@evansde77
evansde77 / mock_requests.py
Last active January 31, 2024 08:49
Example of mocking requests calls
#!/usr/bin/env python
"""
mocking requests calls
"""
import mock
import unittest
import requests
from requests.exceptions import HTTPError
@rcubetrac
rcubetrac / rcabook-setup.sh
Created April 6, 2016 20:55
Roundcube LDAP Setup
#!/bin/bash
#------------configuration--------------------------------
# the url of the openldap server
server="ldap://localhost:389";
# the static config file of openldap
config="/etc/ldap/slapd.conf";
# the LDAP base suffix and admin rootdn
@iamralch
iamralch / sshtunnel.go
Last active April 16, 2023 03:07
SSH tunnelling in Golang
package main
import (
"log"
"bufio"
"time"
"os"
"fmt"
"io"
"net"