Skip to content

Instantly share code, notes, and snippets.

View katagaki's full-sized avatar

シン katagaki

View GitHub Profile
@katagaki
katagaki / RemoveSamsungGalaxyS21BloatSingtel
Last active February 19, 2024 12:03
Script to remove bloatware from the SingTel Galaxy S21.
pm uninstall --user 0 android.autoinstalls.config.samsung
pm uninstall --user 0 com.LogiaGroup.LogiaDeck
pm uninstall --user 0 com.android.carrierdefaultapp
pm uninstall --user 0 com.android.chrome
pm uninstall --user 0 com.android.dreams.basic
pm uninstall --user 0 com.android.dreams.phototable
pm uninstall --user 0 com.android.hotwordenrollment.okgoogle
pm uninstall --user 0 com.android.hotwordenrollment.xgoogle
pm uninstall --user 0 com.android.settings.intelligence
pm uninstall --user 0 com.android.stk
@katagaki
katagaki / FlattenAndMerge
Created September 11, 2021 15:38
Flatten and merge subfolders into the parent folder (adjustable depth).
find ./ -maxdepth 2 -type d -exec rsync --progress --remove-source-files -a '{}' ./ ';'
@katagaki
katagaki / RestartiCloudAndViewLogs
Created September 11, 2021 15:41
Restarts iCloud Drive and iCloud services, and opens a streamed log for iCloud Drive.
sudo killall nsurlsessiond && sudo killall cloudd && sudo killall bird
brctl log -w
@katagaki
katagaki / AutomaticallyUpdateSafariBookmarkTitles.swift
Created September 25, 2021 04:42
Fetches and updates the bookmark titles in your Safari Bookmarks HTML file.
import Foundation
// Copy and paste the bookmarks bit from your Safari Bookmarks.html file (between <DL><p> and </DL><p>)
// Replace all the titles with THE_TITLE
var bookmarksList =
"""
<DT><A HREF="https://apps.apple.com/jp/app/id966142320">THE_TITLE</A>
"""
var newString = ""
@katagaki
katagaki / BubbleSort6a.cpp
Last active October 30, 2021 01:11
Bubble sort an array and print some output.
#include <iostream>
#include <string>
// CAUTION: This code is provided AS-IS and should be considered an archive for reference purposes only.
// The code may contain errors or bugs that may not be fixed.
// Implementation of bubble sort to sort array
void sortArray(int* arrayToBeSorted, int arraySize) {
int currentIndex = 0;
@katagaki
katagaki / HeapSort6b.cpp
Created October 30, 2021 01:12
Heap sort an array and print some output.
#include <iostream>
// CAUTION: This code is provided AS-IS and should be considered an archive for reference purposes only.
// The code may contain errors or bugs that may not be fixed.
void heapify(int* arrayToHeap, int heapUpperBound, int rootElementIndex) {
int largestElementIndex = rootElementIndex;
int leftNodeIndex = 2 * rootElementIndex + 1;
int rightNodeIndex = 2 * rootElementIndex + 2;
@katagaki
katagaki / LDES.java
Last active October 30, 2021 01:55
LDES implementation in Java.
import java.util.Scanner;
// CAUTION: This code is provided AS-IS and should be considered an archive for reference purposes only.
// The code may contain errors or bugs that may not be fixed.
class LDES {
public static void main(String[] args) {
do {
@katagaki
katagaki / LDES8.java
Created October 30, 2021 01:55
LDES8 implementation in Java.
import java.util.Arrays;
import java.util.Base64;
import java.util.Scanner;
// CAUTION: This code is provided AS-IS and should be considered an archive for reference purposes only.
// The code may contain errors or bugs that may not be fixed.
class LDES8 {
public static void main(String[] args) {
@katagaki
katagaki / TEA6TS.java
Created October 30, 2021 01:57
6-bit OFB TEA implementation in Java.
import java.math.BigInteger;
// CAUTION: This code is provided AS-IS and should be considered an archive for reference purposes only.
// The code may contain errors or bugs that may not be fixed.
class TEA6TS {
private static final long v = 0x0062891E;
private static final int[] k = {0x42264529, 0x48404D63, 0x51655468, 0x576D5A71};
private static long iv = 0x7FFFFFFFFFFFFFFFL;
@katagaki
katagaki / TEA7TS.java
Created October 30, 2021 01:58
7-bit OFB TEA implementation in Java.
import java.math.BigInteger;
// CAUTION: This code is provided AS-IS and should be considered an archive for reference purposes only.
// The code may contain errors or bugs that may not be fixed.
class TEA7TS {
private static final long v = 0x0062891E;
private static final int[] k = {0x42264529, 0x48404D63, 0x51655468, 0x576D5A71};
private static long iv = 0x7FFFFFFFFFFFFFFFL;