Skip to content

Instantly share code, notes, and snippets.

View ehzawad's full-sized avatar
🎃
Wasteland Baby!

ehzawad ehzawad

🎃
Wasteland Baby!
View GitHub Profile
@ehzawad
ehzawad / python.txt
Last active September 21, 2023 11:23
python md
You can use the GitHub API to search for repositories, code, commits, issues, users, topics etc. Here is an example of how to search for repositories using Python's `requests` library.
```python
import requests
import json
def search_github(keyword):
url = 'https://api.github.com/search/repositories'
params = {'q': keyword}
response = requests.get(url, params=params)
@ehzawad
ehzawad / install-openssl-from-src-mac
Created September 13, 2023 22:42 — forked from byronmansfield/install-openssl-from-src-mac
Install OpenSSL from source Mac OS X
# Install OpenSSL from source on Mac OS X
# prepare workspace
mkdir -p ~/code/build-from-src/ && cd $_
# download source code
curl -LO https://www.openssl.org/source/openssl-1.1.1d.tar.gz
# expand tar
tar -xzvf openssl-1.1.1d.tar.gz
@ehzawad
ehzawad / numa.sh
Created September 13, 2023 09:03
numa solution!!
#!/bin/bash
if [[ "$EUID" -ne 0 ]]; then
echo "Please run as root."
exit 1
fi
PCI_ID=$(lspci | grep "VGA compatible controller: NVIDIA Corporation" | cut -d' ' -f1)
#PCI_ID="0000:$PCI_ID"
for item in $PCI_ID
do
item="0000:$item"
absl-py==0.15.0
asttokens==2.4.0
astunparse==1.6.3
backcall==0.2.0
cachetools==5.3.1
certifi==2023.7.22
charset-normalizer==3.2.0
clang==5.0
comm==0.1.4
decorator==5.1.1
absl-py==0.13.0
aio-pika==6.8.2
aiofiles==23.1.0
aiohttp==3.7.4
aiormq==3.3.1
APScheduler==3.7.0
astunparse==1.6.3
async-generator==1.10
async-timeout==3.0.1
attrs==21.2.0
from ytmusicapi import YTMusic
# Initialize YTMusic using your OAuth credentials
ytmusic = YTMusic("oauth.json")
# Search for a song
search_results = ytmusic.search('Blank Space By Taylor Swift')
# Check if search results are empty
if not search_results:
# version: "3.1"
# stories:
# - story: stop form + continue
# steps:
# - intent: request_restaurant
# - action: restaurant_form
# - active_loop: restaurant_form
# - intent: stop
# - action: utter_ask_continue
# - intent: affirm
version: '3.8'
services:
db:
image: mariadb:10.6.4-focal
command: '--default-authentication-plugin=mysql_native_password'
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
- MYSQL_ROOT_PASSWORD=somewordpress
import openai
import re
# Define GPT-3.5-turbo API key
openai_api_key = 'YOUR-OPENAI-API-KEY'
openai.api_key = openai_api_key
# Read the Bengali text from the file
with open('/home/ehz/Downloads/nlu.txt', 'r', encoding='utf-8') as file:
bengali_text = file.read()
absl-py==1.4.0
aio-pika==8.2.3
aiofiles==23.1.0
aiogram==2.25.1
aiohttp==3.8.5
aiohttp-retry==2.8.3
aiormq==6.4.2
aiosignal==1.3.1
APScheduler==3.9.1.post1
astunparse==1.6.3