Skip to content

Instantly share code, notes, and snippets.

Avatar

Satadru Pramanik satmandu

View GitHub Profile
@satmandu
satmandu / google-chrome.desktop
Last active Mar 3, 2022
The google-chrome.desktop I use on Ubuntu 22.04 on my MBP11,3. Put in /usr/share/applications/ . Also, I use a patched mesa as per https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5139#note_1279423
View google-chrome.desktop
[Desktop Entry]
Version=1.0
Name=Google Chrome
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Web Browser
GenericName[ar]=متصفح الشبكة
GenericName[bg]=Уеб браузър
GenericName[ca]=Navegador web
GenericName[cs]=WWW prohlížeč
@satmandu
satmandu / gist:37ce878ba5c3e002b7cb6c3a47aa598a
Last active Feb 23, 2022
Extract macos dmg with pkg inside from Linux (ubuntu 22.04)
View gist:37ce878ba5c3e002b7cb6c3a47aa598a
# Install build prereqs:
sudo apt-get install build-essential libxml2-dev libssl-dev zlib1g-dev
# You can extract a dmg using 7z thus: 7z x File.dmg
# This installs tools like lsbom to see what is inside bom files
git clone https://github.com/hogliux/bomutils && cd bomutils && make && sudo make install
# Now install xar so you can extract the pkg file
curl -OLf https://opensource.apple.com/tarballs/xar/xar-425.2.tar.gz
tar fxv xar-425.2.tar.gz
cd xar-425.2/xar/
curl -OLf https://raw.githubusercontent.com/macports/macports-ports/master/archivers/xar/files/xar-1.8-openssl-1.1.patch
@satmandu
satmandu / ubuntu-mainline-kernel.sh
Created Dec 18, 2021
Ubuntu Mainline Kernel update script , modified from forks of https://github.com/pimlie/ubuntu-mainline-kernel.sh
View ubuntu-mainline-kernel.sh
#!/usr/bin/env bash
# shellcheck disable=SC1117
# Ubuntu Kernel PPA info
ppa_host="kernel.ubuntu.com"
ppa_index="/~kernel-ppa/mainline/"
ppa_key="17C622B0"
# If quiet=1 then no log messages are printed (except errors)
@satmandu
satmandu / chromeos_docker.sh
Last active Aug 5, 2021
Updated ChromeOS docker container script
View chromeos_docker.sh
#!/bin/bash
# chromeos_docker.sh
# Usage:
# chromeos_docker.sh recoveryfileurl name milestone arch
# or if image.bin already exists this works too:
# chromeos_docker.sh dummy name milestone arch
# (Default is not to delete the image after download.)
# e.g.
# Example for x86_64:
# chromeos_docker.sh https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_13816.82.0_nocturne_recovery_stable-channel_mp.bin.zip nocturne 90 x86_64
@satmandu
satmandu / gcc10.rb
Created Apr 14, 2021
gcc 10.3.0 chromebrew package WIP
View gcc10.rb
require 'package'
class Gcc10 < Package
description 'The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Ada, and Go.'
homepage 'https://www.gnu.org/software/gcc/'
version '10.3.0'
@isl_ver = '0.23'
compatibility 'all'
license 'GPL-3'
source_url 'https://gcc.gnu.org/pub/gcc/releases/gcc-10.3.0/gcc-10.3.0.tar.xz'
@satmandu
satmandu / getdeps
Last active Mar 25, 2021
Chromebrew get actual runtime dependencies for a package
View getdeps
#!/bin/env bash
# set -x
pkg="${1}"
CREW_LIB_PREFIX=$(crew const | grep CREW_LIB_PREFIX | awk -F = '{print $2}')
# Which packages have a needed library in CREW_LIB_PREFIX
# This is a subset of what crew whatprovides gives
whatprovidesfxn() {
pkgdepslcl="${1}"
filelcl=$(grep "$pkgdepslcl" /usr/local/etc/crew/meta/*.filelist | grep $CREW_LIB_PREFIX)
@satmandu
satmandu / llvm.rb
Last active Dec 19, 2020
llvm 11.0.1-rc2 for chromebrew
View llvm.rb
require 'package'
class Llvm < Package
description 'The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. The optional packages clang, lld, lldb, polly, compiler-rt, libcxx, libcxxabi and openmp are included.'
homepage 'http://llvm.org/'
version '11.0.1-rc2'
compatibility 'all'
source_url 'https://github.com/llvm/llvm-project/archive/llvmorg-11.0.1-rc2.tar.gz'
source_sha256 'c217780b9903eabf0fdb8ed227ae50b623d3f82afb9ac36beffbc81acbc6ff6c'
@satmandu
satmandu / zfs_build
Last active Jan 9, 2021
Compiles zfs 2.0.1 for ubuntu & debian systems (tested on x86_64 [groovy] and arm64 [raspi_os]). Not tested with zsys. . In a new folder do this to make zfs debs: curl -OLf https://gist.github.com/satmandu/3aebcd7d26cdc588b40af29f1be6009c/raw/8bd4ce4dc67ba258b9b6f613c1b604fdade9e552/zfs_build && chmod +x zfs_build && ./zfs_build
View zfs_build
#!/bin/bash -x
main () {
VER=10
export CC="ccache gcc-${VER}"
export CXX="ccache g++-${VER}"
export SHLIB_CXXLD="g++-${VER}"
#FC="ccache gfortran"
#F77="ccache gfortran"
zfs_work="$(pwd)/$(uname -m)"
mkdir -p "${zfs_work}"
@satmandu
satmandu / chromeos_docker.sh
Last active Mar 16, 2021
Docker buildx based package builder for Chromebrew on x86_64, i686, & armv7l. (armv7l only tested on Raspberry PI) Put both files in the same folder.
View chromeos_docker.sh
#!/bin/bash
# chromeos_docker.sh
# Usage:
# chromeos_docker.sh recoveryfileurl name milestone arch
# or if image.bin already exists this works too:
# chromeos_docker.sh dummy name milestone arch
# (Default is not to delete the image after download.)
# e.g.
# Example for x86_64:
# chromeos_docker.sh https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_13505.73.0_nocturne_recovery_stable-channel_mp.bin.zip nocturne 87 x86_64
@satmandu
satmandu / sommelier.rb
Last active Oct 19, 2020
WIP Platform2 Sommelier for chromebrew
View sommelier.rb
require 'package'
class Sommelier < Package
description 'Sommelier works by redirecting X11 and Wayland programs to the built-in ChromeOS wayland server.'
homepage 'https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/vm_tools/sommelier/'
version '2237607'
compatibility 'all'
source_url 'https://chromium-review.googlesource.com/changes/chromiumos%2Fplatform2~2237607/revisions/10/patch?zip&path=%2FCOMMIT_MSG'
source_sha256 '0dda9635fe947383e0a4abc573a289acbd81e07115dbb1aaafcc7f3b85a35d6a'