Skip to content

Instantly share code, notes, and snippets.

View halibegic's full-sized avatar
🎯
Focusing

Hasan Alibegić halibegic

🎯
Focusing
View GitHub Profile
@halibegic
halibegic / install-cursor-sh
Created July 22, 2025 07:07 — forked from tatosjb/install-cursor-sh
install-cursor.sh
#!/bin/bash
# To install on ubuntu
# curl -fsSL https://gist.github.com/tatosjb/0ca8551406499d52d449936964e9c1d6/raw/28459ee07900ef76081c9e276cd94d707bed73a9/install-cursor-sh | bash
installCursor() {
if ! [ -f /opt/cursor.appimage ]; then
echo "Installing Cursor AI IDE..."
mkdir -p "$HOME/Applications/cursor"
# URLs for Cursor AppImage and Icon
git reset --hard cedc856
git push --force origin main
find . -name '.DS_Store' -type f -delete
@halibegic
halibegic / nginx-default-server
Created October 18, 2018 18:56
Nginx default server block file
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name _;
location / {
@halibegic
halibegic / update-namecheap-ddns.sh
Last active October 19, 2018 12:12
Update Namecheap Dynamic DNS
#!/bin/sh
# Config
HOST=@
DOMAIN="your-domain"
PASSWORD="your-password"
# Others
LAST_IP_FILE=/tmp/last-ip.txt
TIME="`date +%Y-%m-%d:%H:%M`"
local hostname="%{$fg_bold[green]%}%m"
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
PROMPT='${hostname} ${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}) "
@halibegic
halibegic / [Android] Enable DEBUG mode in HUAWEI phone
Created November 14, 2017 14:46 — forked from shallowlong/[Android] Enable DEBUG mode in HUAWEI phone
How to enable the "DEBUG" level log in a HUAWEI android phone (not checking the different kinds of HUAWEI phones, but should be okay to use). The problem here is that in the LogCat, the debug level logs cannot be viewed when using a HUAWEI android phone. There are several steps to activate the DEBUG level log inside a HUAWEI phone. This knowledg…
dial *#*#2846579#*#*
select 'ProjectMenu'
select 'Background Setting'
select 'Log Setting'
select 'Log Switch'
enable 'LOG on'
Select 'Log level setting'
enable 'DEBUG'
Press the 'Back' key
select 'Dump and Log'
@halibegic
halibegic / changeLanguageSettings.java
Last active July 19, 2017 11:22
Change Android System Language
public void changeLanguageSettings(String language, String country) {
try {
//Set language
Locale locale = new Locale(language, country);
//Getting by reflection the ActivityManagerNative
Class amnClass = Class.forName("android.app.ActivityManagerNative");
Object amn = null;
Configuration config = null;
@import url('https://fonts.googleapis.com/css?family=Ubuntu:400,400i,700,700i&subset=latin-ext');
html * {
font-family: "Ubuntu", sans-serif !important;
}
#overlay {
background: #2e3243;
}
@halibegic
halibegic / Installed packages
Last active April 25, 2017 07:18
List all installed Android packages
pm list packages -f