Skip to content

Instantly share code, notes, and snippets.

@ismailkarsli
ismailkarsli / cloud-init.yaml
Last active August 28, 2023 12:10
cloud-init.yaml
#cloud-config
users:
- name: ismail
groups: users, admin
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
ssh_authorized_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPdJr63tCOvAaA42XTABCY1BL6jRNwq7qNF5uoNNsqoY ismail@karsli.net
package_update: true
package_upgrade: true
@linkbot@lemmy.link
@bot@lemmit.online
@KensandRssBot@lemmy.kensand.net
@PostBot@chat.maiion.com
@lemmybot@lemmy.staphup.nl
@philly_bot@fanaticus.social
@bot@lemmy.smeargle.fans
@brianfan@lemmy.smeargle.fans
@rss_bot@lemmy.amyjnobody.com
@aihorde@lemmy.dbzer0.com
@ismailkarsli
ismailkarsli / docker-auto-prune.sh
Created June 4, 2023 19:52
Automatically prune docker system when disk limit exceeds
#!/bin/sh
ROOT_FS_USAGE=$(df -H / | grep -vE 'Filesystem' | awk '{ print $5}' | cut -d'%' -f1)
DISK_LIMIT=${DISK_LIMIT:-75}
if [ "$ROOT_FS_USAGE" -ge "$DISK_LIMIT" ]; then
echo "Cleaning up docker images"
docker system prune -af --filter="until=1h"
fi
@ismailkarsli
ismailkarsli / launch.json
Created October 14, 2021 13:25
Vue için Chrome debug
{
"version": "0.2.0",
"configurations": [
{
"type": "pwa-chrome",
"request": "attach",
"name": "Chrome debug",
"urlFilter": "http://localhost:8080/*",
"port": 9222,
"webRoot": "${workspaceFolder}/src",
version: "2.1"
services:
sonarr:
image: linuxserver/sonarr
container_name: sonarr
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Istanbul
import React from "react";
import CKEditor from "@ckeditor/ckeditor5-react";
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
import "@ckeditor/ckeditor5-build-classic/build/translations/tr.js";
import { useMutation } from "@apollo/client";
import { UPLOAD_PHOTO } from "../../gql/photo/mutation";
class UploadAdapter {
constructor(loader, uploadPhoto) {
this.loader = loader;
@ismailkarsli
ismailkarsli / windows-wallpaper.py
Created August 20, 2020 20:27
Simple Python class for get, set and copy wallpaper on Windows
# Wallpaper.get() Get current wallpapers path. For getting as Pillow image object, use True as parameter.
# Wallpaper.set() Set wallpaper. Can be path of image or Pillow object. File type doesn't matter and path can be absolute or relative.
# Wallpaper.copy() - Copy current wallpaper. First parameter is directory and the second is file name. File extension should be JPG. Default directory is current directory and file name is 'wallpaper.jpg'
from os import path, getenv, getcwd
from ctypes import windll
from shutil import copyfile
from PIL import Image
from tempfile import NamedTemporaryFile