Skip to content

Instantly share code, notes, and snippets.

View shawonashraf's full-sized avatar
🐈
I'm simply not there.

Shawon Ashraf shawonashraf

🐈
I'm simply not there.
View GitHub Profile
@shawonashraf
shawonashraf / unzipper.py
Created March 29, 2021 14:18
Unzip zip files in python
import zipfile
zip_ref = zipfile.ZipFile("arc.zip", "r") # path to zipfile
zip_ref.extractall("target") # target dir
zip_ref.close()
@shawonashraf
shawonashraf / rocm-opencl.md
Created February 26, 2021 19:07
AMD Navi (Radeon RX 5500, 5600, 5700) OpenCL with ROCm for Fedora (and REHL, CentOS, ...)

AMD Navi OpenCL with ROCm

Mesa doesn't provide OpenCL 1.2 support for Navi

AMD provide closed-source AMDGPU-PRO OpenCL 2.0 (PAL for Vega and Navi and Legacy for older product)

Alternatively you can use open-sourced AMD Radeon Open Compute platforM with OpenCL 2.0 support (Hardware Support)

It doesn't breaks Mesa/LLVM dependencies or UEFI Secure Boot

@shawonashraf
shawonashraf / error.txt
Created February 24, 2021 05:27
DAZN FF Error
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://optmzly.fe.indazn.com/datafiles/EG81YwqcK6nE62HXHW6uVG.json. (Reason: CORS request did not succeed).
Loading failed for the <script> with source “https://cdn.cookielaw.org/scripttemplates/otSDKStub.js”. home:1:1
TypeError: c(...)[0] is undefined
trackHeaderLoadTime https://www.dazn.com/chapters/de/openbrowse/dazn-modules~build~cf14c748.js:1
value https://www.dazn.com/chapters/de/openbrowse/build.js:1
iu https://www.dazn.com/chapters/de/openbrowse/vendor.js:126
ds https://www.dazn.com/chapters/de/openbrowse/vendor.js:126
unstable_runWithPriority https://www.dazn.com/chapters/de/openbrowse/vendor.js:60
Vo https://www.dazn.com/chapters/de/openbrowse/vendor.js:126
ps https://www.dazn.com/chapters/de/openbrowse/vendor.js:126
@shawonashraf
shawonashraf / Output.txt
Last active December 7, 2020 01:23
IRTM EX2 Output
wei* AND maße => [0, 115, 125, 168, 286, 430, 457, 471, 1002, 1005, 1012, 1020, 1025, 1032, 1036, 1042, 1043, 1047, 1053, 1055, 1065, 1066, 1069, 1072, 1081, 1088, 1095, 1115, 1116, 1119, 1129, 1149, 1155, 1171, 1173, 1176, 1178, 1183, 1188, 1195, 1202, 1207, 1225, 1226, 1232, 1249, 1259, 1266, 1281, 1301, 1313, 1317, 1334, 1337, 1342, 1348, 1372, 1376, 1399, 1400, 1405, 1407, 1429, 1444, 1451, 1458, 1470, 1473, 1479, 1496, 1505, 1510, 1518, 1545, 1548, 1549, 1556, 1563, 1564, 1572, 1573, 1579, 1582, 1587, 1601, 1610, 1630, 1631, 1636, 1646, 1652, 1654, 1658, 1659, 1678, 1679, 1687, 1694, 1697, 1701, 1723, 1732, 1744, 1745, 1754, 1755, 1759, 1761, 1764, 1770, 1790, 1809, 1813, 1817, 1836, 1842, 1844, 1864, 1868, 1880, 1885, 1887, 1897, 1902, 1913, 1924, 1929, 1938, 1955, 1957, 1968, 1973, 1987, 2004, 2008, 2015, 2055, 2064, 2071, 2073, 2083, 2116, 2124, 2135, 2137, 2142, 2145, 2151, 2153, 2158, 2165, 2199, 2203, 2215, 2218, 2219, 2231, 2266, 2273, 2280, 2296, 2297, 2300, 2310, 2331, 2338, 2361, 2362, 2377, 2
@shawonashraf
shawonashraf / cnn.py
Created November 20, 2020 21:20
TF Apple Fork test on mnist data
import tensorflow as tf
from tensorflow.python.compiler.mlcompute import mlcompute
mlcompute.set_mlc_device(device_name='gpu')
mnist = tf.keras.datasets.mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()
@shawonashraf
shawonashraf / boolean_and_query.py
Created November 16, 2020 21:13
irtm boolean and
paris = [1, 2, 3, 4, 5, 7, 8, 9, 11, 12, 13, 14, 15]
france = [2, 6, 10, 12, 14]
def query(posting1, posting2):
result = []
it1 = iter(posting1)
it2 = iter(posting2)
el1 = next(it1)
@shawonashraf
shawonashraf / geoplot.py
Created November 6, 2020 13:19
For Tahmid Vai's work
ncols = 3
nrows = 4
# create a figure of dimension nrows X ncols
fig, ax = plt.subplots(nrows=nrows, ncols=ncols, figsize=(20, 15))
# keeps track of the indexes of iaq
df_idx_counter = 0
# iterate through the grid and plot one iaq element in each grid box
@shawonashraf
shawonashraf / dm-toilet-paper.js
Created October 22, 2020 12:11 — forked from marco79cgn/dm-toilet-paper.js
Scriptable iOS widget that shows the amount of toilet paper which is available at your next dm drugstore
let storeId = 386
let param = args.widgetParameter
if (param != null && param.length > 0) {
storeId = param
}
const storeCapacity = await fetchAmountOfPaper()
const storeInfo = await fetchStoreInformation()
const widget = new ListWidget()
await createWidget()
def merge_sort(arr):
if len(arr) > 1:
middle = len(arr) // 2
left = arr[:middle]
right = arr[middle:]
merge_sort(left)
merge_sort(right)
@shawonashraf
shawonashraf / alex_torch.py
Created July 7, 2020 11:27
Alexnet draft PyTorch
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.utils.data as data
import skimage
import skimage.io
import skimage.transform