Skip to content

Instantly share code, notes, and snippets.

View ionescu77's full-sized avatar
🎯
Focusing

Răzvan Ionescu ionescu77

🎯
Focusing
View GitHub Profile
@tahmidsadik
tahmidsadik / purgeAndroid.txt
Created September 19, 2015 18:47
How to completely remove Android Studio from Mac OS X
How to Completely Remove Android Studio
Execute these commands from the terminal
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
@gabrieljcs
gabrieljcs / lvm-cache-fedora.md
Last active May 22, 2024 14:31
Instructions to create an LVM cache for root in Fedora

LVM cache in Fedora

From the man-pages: "The cache logical volume type uses a small and fast LV to improve the performance of a large and slow LV. It does this by storing the frequently used blocks on the faster LV. LVM refers to the small fast LV as a cache pool LV. The large slow LV is called the origin LV. Due to requirements from dm-cache (the kernel driver), LVM further splits the cache pool LV into two devices - the cache data LV and cache metadata LV. The cache data LV is where copies of data blocks are kept from the origin LV to increase speed. The cache metadata LV holds the accounting information that specifies where data blocks are stored (e.g. on the origin LV or on the cache data LV). Users should be familiar with these LVs if they wish to create the best and most robust cached logical volumes. All of these associated LVs must be in the same VG."

Assuming LVM is already setup in HDD (e.g. from anaconda) and SSD is untouched.

Create a physical

@romuald
romuald / processlist.sql
Last active April 16, 2024 20:15
Show PostgreSQL current (running) process list;
SELECT user, pid, client_addr, waiting, query, query_start, NOW() - query_start AS elapsed
FROM pg_stat_activity
WHERE query != '<IDLE>'
-- AND EXTRACT(EPOCH FROM (NOW() - query_start)) > 1
ORDER BY elapsed DESC;
@strategyst
strategyst / local-business-schema-microdata-html
Created September 1, 2016 17:55
Local business HTML with microdata schema
<div itemscope itemtype="http://schema.org/LocalBusiness">
<h2><span itemprop="name">Super Shop</span></h2>
<p><span itemprop="description">A super shop that sells everything at super low prices.</span></p>
<address itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">123 Example Street</span>
<span itemprop="addressLocality">Example Town</span>,
<span itemprop="addressRegion">Essex</span>
</address>
Phone: <a href="tel:01234567890"><span itemprop="telephone">01234 567890</span></a>
</div>
@vees
vees / Lenovo Thinkcentre M92P.txt
Last active July 30, 2023 05:46
Ubuntu and UEFI on Lenovo Thinkcentre M92P
Lenovo Thinkcentre M92P
When booting to USB installer disk installation proceeds as expected
1962 no operating system found
When booting into preview mode all disks load without issue, so its not the cable
Secure Boot option either not present or disabled
Last time I fixed this by adding a fake line to the boot loader from instructions on the web
Got a warning during installation about UEFI mode
Windows Fast Startup disabled
jfly comment below:
@martinec
martinec / .gitignore.local for gitignore.io
Last active May 11, 2021 14:19
.gitignore.local for gitignore.io
git config --global alias.ignore-create '!gi() { \
if [ $# -eq 0 ]; then \
echo "Usage: git ignore-create list-item,...\n" ;\
echo "Avalaible list items:" ;\
curl -sL "https://www.gitignore.io/api/list" | tr -d "\n" ;\
echo "" ;\
else \
echo "# DO NOT EDIT THIS FILE" ;\
echo "# Put your local changes on .gitignore.local, then\n" ;\
echo "# To update type: git ignore-update" ;\
<div class="row" style="margin-bottom: 12px;">
<div class="col-md-12" style="text-align: center;">
This page will refresh in <div class="time">{{minutes}}</div> Min <div class="time">{{seconds}}</div> Sec
</div>
</div>
@prudnikov
prudnikov / atomic_viewsets.py
Created December 17, 2019 09:55
Django Rest Framework Atomic ViewSet and Mixin.
from django.db import transaction
from rest_framework import mixins
from rest_framework.viewsets import GenericViewSet
__all__ = ['AtomicCreateModelMixin', 'AtomicUpdateModelMixin', 'AtomicDestroyModelMixin',
'AtomicModelViewSetMixin', 'AtomicModelViewSet']
class AtomicCreateModelMixin(mixins.CreateModelMixin):
@pR0Ps
pR0Ps / unifi-update.sh
Last active September 24, 2022 19:10
Update a UniFi Controller installation on Alpine Linux
#!/bin/sh
####################################
# Update a UniFi Controller installation on Alpine Linux
#
# Assumes that the unifi service can be manipulated with "rc-service unifi <start/stop>"
#
# For initial installation see https://wiki.alpinelinux.org/wiki/UniFi_Controller
# Additional steps:
# - apk add --no-cache libc6-compat