Skip to content

Instantly share code, notes, and snippets.

View sefacan's full-sized avatar

Sefa Can sefacan

View GitHub Profile
@sefacan
sefacan / minikube.md
Created October 21, 2023 11:10 — forked from rahulkumar-aws/minikube.md
Install/Uninstall Minikube from Mac
minikube stop; minikube delete
docker stop $(docker ps -aq)
rm -r ~/.kube ~/.minikube
sudo rm /usr/local/bin/localkube /usr/local/bin/minikube
systemctl stop '*kubelet*.mount'
sudo rm -rf /etc/kubernetes/
docker system prune -af --volumes
#!/bin/sh
openssl genrsa -out key.pem 2048
openssl req -new -sha256 -key key.pem -out csr.csr
openssl req -x509 -sha256 -days 365 -key key.pem -in csr.csr -out certificate.pem
openssl req -in csr.csr -text -noout | grep -i "Signature.*SHA256" && echo "All is well" || echo "This certificate will stop working in 2017! You must update OpenSSL to generate a widely-compatible certificate"
mv key.pem ./ssl/cert.key
mv certificate.pem ./ssl/cert.pem
mv csr.csr ./ssl/
public class CollectionUtils
{
public static bool AreEquals<T>(IEnumerable<T> items, IEnumerable<T> otherItems)
{
return new HashSet<T>(items)
.SetEquals(otherItems);
}
public static bool IsEmpty(IEnumerable items) => items == null || !items.GetEnumerator().MoveNext();
@sefacan
sefacan / userscript.js
Created January 6, 2022 21:30 — forked from tarikguney/userscript.js
Eat Your Food - Netflix Interruptor
// ==UserScript==
// @name Remember to eat your food while watching Netflix
// @namespace https://www.tarikguney.com
// @version 0.1
// @description Kids watching cartoons on Netflix often forget to eat and chew their food, which drives parents crazy. You need to sit down with them and pause the video and remind them to eat their food. This script will automate that.
// @author Tarik Guney
// @match https://www.netflix.com/watch/*
// @icon https://upload.wikimedia.org/wikipedia/commons/thumb/7/75/Netflix_icon.svg/1200px-Netflix_icon.svg.png
// @grant none
// ==/UserScript==
@sefacan
sefacan / needion.md
Last active December 8, 2023 15:08
Google tag manager conversion

Site geneli tag manager script

<!-- Global site tag (gtag.js) - Google Ads: 123456789 -->
  <script async src="https://www.googletagmanager.com/gtag/js?id=AW-123456789"></script>
  <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', 'GA_TRACKING_ID');
@sefacan
sefacan / FirebaseNotification.cs
Created October 29, 2020 17:01
Firebase Notification
public async Task<bool> SendNotificationAsync(string token, string title, string body)
{
using (var client = new HttpClient())
{
var firebaseOptionsServerId = _firebaseOptions.ServerApiKey;
var firebaseOptionsSenderId = _firebaseOptions.SenderId;
client.BaseAddress = new Uri("https://fcm.googleapis.com");
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.TryAddWithoutValidation("Authorization",
@sefacan
sefacan / NginxReloadBug
Created September 24, 2020 14:08 — forked from sun4lower/NginxReloadBug
nginx: [error] invalid PID number "" in "/var/run/nginx.pid"
pkill -9 nginx
nginx -c /etc/nginx/nginx.conf
nginx -s reload
using Newtonsoft.Json.Linq;
using RestSharp;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web.Mvc;
using System.Web.Script.Serialization;
namespace Admin.Controllers
@sefacan
sefacan / postgresql.conf
Created September 7, 2020 14:11
postgresql.conf
# -----------------------------
# PostgreSQL configuration file
# -----------------------------
#
# This file consists of lines of the form:
#
# name = value
#
# (The "=" is optional.) Whitespace may be used. Comments are introduced with
# "#" anywhere on a line. The complete list of parameter names and allowed
/*!
Math.uuid.js (v1.4)
http://www.broofa.com
mailto:robert@broofa.com
Copyright (c) 2010 Robert Kieffer
Dual licensed under the MIT and GPL licenses.
*/
/*