Skip to content

Instantly share code, notes, and snippets.

View cobaohieu's full-sized avatar

Hieu C B cobaohieu

View GitHub Profile
@cobaohieu
cobaohieu / stop-all-docker.md
Created September 28, 2025 18:09 — forked from atomkirk/stop-all-docker.md
Stop all Docker containers

I will often run this command to make sure all my docker containers are stopped and removed before running docker-compose up. Sometimes when you restart your system, old containers will start back up automatically in the background.

docker stop $(docker ps -aq) && docker rm $(docker ps -aq)
@cobaohieu
cobaohieu / makedeb.sh
Created June 7, 2025 08:25 — forked from rafael-neri/makedeb.sh
Simple script to create debian package
#!/bin/bash
# Distributed under the GNU GPL
# Check if user is root
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
# Get path
@cobaohieu
cobaohieu / howto_deb_repackage.txt
Created June 7, 2025 08:25 — forked from shamil/howto_deb_repackage.txt
Howto repackage deb packages
Use folowing steps to repackage dep package:
1: Extract deb package
# dpkg-deb -x <package.deb> <dir>
2: Extract control-information from a package
# dpkg-deb -e <package.deb> <dir/DEBIAN>
3. After completed to make changes to the package, repack the deb
# dpkg-deb -b <dir> <new-package.deb>
@cobaohieu
cobaohieu / PrintBootCampESDInfo.swift
Last active December 15, 2024 17:39 — forked from nuomi1/PrintBootCampESDInfo.swift
macOS and BootCamp Latest
#!/usr/bin/env swift
//
// PrintBootCampESDInfo.swift
//
// Created by nuomi1 on 8/5/18.
// Copyright © 2018年 nuomi1. All rights reserved.
//
import Foundation
@cobaohieu
cobaohieu / how-to-install-ubuntu-on-MacbookPro-11,5.md
Last active June 12, 2025 09:10 — forked from gbrow004/ubuntu-MBP-16.md
How to install Ubuntu on Apple Macbook Pro 15-inch (2015)

Acknowledgements Install Ubuntu on Macbook Pro

Requirements

2 USB drives >= 8GB

Pre-Install

##install https://brew.sh
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew upgrade
##nvidia gfx driver install
https://github.com/vulgo/webdriver.sh
@cobaohieu
cobaohieu / gist:1c3634a18d7b8a716bc98b5151ca050b
Last active September 7, 2021 17:01 — forked from tzvsi/gist:222b3b22a847004a729744f89fe31255
Installing CUDA 10.2, CuDNN 8.0.2, TensorRT 8.0.1, Ubuntu 18.04

Step 1: Installing CUDA (~5.5 minutes)

You can also install CUDA directly from the offline installer, but this is a little easier.

sudo apt update
sudo apt upgrade -y

mkdir install ; cd install
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
@cobaohieu
cobaohieu / opencv_qt_label.md
Created August 11, 2021 12:56 — forked from docPhil99/opencv_qt_label.md
How to display opencv video in pyqt apps

The code for this tutorial is here

Opencv provides are useful, but limited, method of building a GUI. A much more complete system could be acheived using pyqt. The question is, how do we display images. There are quite a few possible routes but perhaps the easiest is to use QLabel since it has a setPixmap function. Below is some code that creates two labels. It then creates a grey pixmap and displays it one of the labels. code: staticLabel1.py

from PyQt5.QtWidgets import QWidget, QApplication, QLabel, QVBoxLayout
from PyQt5.QtGui import QPixmap, QColor
import sys
@cobaohieu
cobaohieu / resizeImg.py
Last active July 21, 2021 09:39 — forked from justudin/resizeImg.py
bulk resize image with python with its its corresponding subdirectory/folder
# -*- coding: utf-8 -*-
"""
Clone on Wed Jul 21 16:39:29 2021
@author: xyz
This code is used to resize the images from dir/subdir to new directory (newdir/subdir) with its corresponding subdirectory
Original folder with it subdir:
./vegetables