Skip to content

Instantly share code, notes, and snippets.

@delirehberi
delirehberi / functions.sh
Created October 12, 2023 15:57
functions.sh
#find and replace in directory or file
#usage example frf ./where search replace
frf() {
echo "find $1 -type f -exec sed -i \"s+$2+$3+g\" {} \;";
}
#git push activebranch to origin
gpo() {
activeBranch=$(git branch|grep '*'|tr -d '* ')
git push origin $activeBranch
}
@delirehberi
delirehberi / communities.json
Last active August 4, 2023 11:12
community-list in turkey.
[{
"name": "Aydın Yazılımcı Ağı",
"lat": 37.8632398,
"lng": 27.266873,
"url": "http://aydinyazilimciagi.github.io",
"keywords": "co-working, keynote, coffee-talk"
},
{
"name": "Devİzmir ",
"lat": 38.43246841430664,
@delirehberi
delirehberi / create-hotspot.md
Last active March 14, 2023 17:09 — forked from narate/create-hotspot.md
Create Wi-Fi Hotspot on Linux using nmcli

Create a Wi-Fi hotspot on Linux using nmcli

Original post : https://unix.stackexchange.com/a/310699

nmcli con add type wifi ifname wlp0s20f3 con-name delirehberiwifi autoconnect yes ssid delirehberiwifi
nmcli con modify delirehberiwifi 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
nmcli con modify delirehberiwifi wifi-sec.key-mgmt wpa-psk
nmcli con modify delirehberiwifi wifi-sec.psk "deliloy1542"

Keybase proof

I hereby claim:

  • I am delirehberi on github.
  • I am delirehberi (https://keybase.io/delirehberi) on keybase.
  • I have a public key ASAFVOwYa61VBt8Z5jUdNGgDuOQxJBjRYvS929z3uJNKJgo

To claim this, I am signing this object:

@delirehberi
delirehberi / lastpass2pass.sh
Created March 9, 2021 14:03
Lastpass importer for passwordstore
#!/usr/bin/env bash
exec < ./lastpass_export.csv
read header
while IFS="," read -r url username password extra name grouping fav
do
ins="$password\n
---\n
url: $url\n
username: $username \n
password: $password \n
@delirehberi
delirehberi / soundcloud.js
Created July 20, 2020 23:23
soundcloud bulk delete
//go to that location
window.location = "https://soundcloud.com/you/tracks";
//select all tracks on the page.
document.querySelectorAll("input[type='checkbox']").forEach((a,b)=>{a.click();});
//define remover function
let remover = function(){
let a = document.querySelector(".trackManagerTrackList__item");
if(!a) {
clearInterval(window.d);
}
{ pkgs ? import <nixpkgs> {} }:
let
ihpDev = builtins.fetchTarball {
url= "https://beta:beta@ihp.digitallyinduced.com/ihp-new.tar.gz";
sha256 = "0kmrb8w96qpwfjm8h3fa8dpmz94zl096n5xvsdgkk70gw76hjg1m";
};
NB_USER = "ihp";
NB_UID = "1000";
dockerEtc = pkgs.runCommand "docker-etc" {} ''
mkdir -p $out/etc/pam.d
version: '3'
services:
php:
build:
context: ./docker/php
ports:
- 9000:9000
volumes:
- ./:/app/
- ./docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
module InstagramService.Client where
import Control.Monad (unless)
import GHC.Generics
import Network.Socket hiding (recv)
import Network.Socket.ByteString.Lazy (recv,sendAll)
import Data.Aeson
data EmulatorRequestParameters = UserRequest {
@delirehberi
delirehberi / road.hs
Last active February 22, 2020 01:40
shortest_way.hs
import Data.List
main = do
contents <- getContents
let
threes = groupsOf 3 (map read $ lines contents)
roadSystem = map (\[a,b,c] -> Section a b c) threes
path = optimalPath roadSystem
pathString = concat $ map (show . fst) path
pathPrice = sum $ map snd path