Skip to content

Instantly share code, notes, and snippets.

installed=$(pacman -Q linux | sed 's/.arch1-1//' | sed 's/linux //');used=$(uname -r | sed 's/-arch1-1//');orphans=$(pacman -Qdtq);packagecount=$(pacman -Q | wc -l);echo "installed:" $installed; echo "used:" $used; [[ $installed != $used ]] && echo "reboot is needed" || echo "reboot is not needed" && echo "" && ( [[ $orphans != "" ]] && echo "orphans: ${orphans}" || true ) && echo "package count: ${packagecount}"
git submodule update --init --recursive
javascript:(function(){javascript:{var s = window.location.href.toString();var p=/(\d+)/gi;if (p.test(s)){try{var n=s.match(p)[0];window.open('https://letterboxd.com/tmdb/'+n);}catch(e){}}};void(0); })();
@boratanrikulu
boratanrikulu / ctld-to-name.go
Last active December 7, 2020 09:57
ctld-to-name.go
// countryTopLevelDomains keeps country coudes for packetstream names.
var countryTopLevelDomains = map[string]string{
"ae": "UnitedArabEmirates",
"af": "Afghanistan",
"al": "Albania",
"am": "Armenia",
"ar": "Argentina",
"at": "Austria",
"au": "Australia",
"aw": "Aruba",
// countryTopLevelDomains includes all country-code-top-level-domains.
// source: https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains
var countryTopLevelDomains = []string{
"ac", "ad", "ae", "af", "ag", "ai", "al", "am", "ao", "aq", "ar", "as", "at", "au", "aw", "ax", "az", "ba", "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bm", "bn", "bo", "bq", "br", "bs", "bt", "bw", "by", "bz", "ca", "cc", "cd", "cf", "cg", "ch", "ci", "ck", "cl", "cm", "cn", "co", "cr", "cu", "cv", "cw", "cx", "cy", "cz", "de", "dj", "dk", "dm", "do", "dz", "ec", "ee", "eg", "eh", "er", "es", "et", "eu", "fi", "fj", "fk", "fm", "fo", "fr", "ga", "gd", "ge", "gf", "gg", "gh", "gi", "gl", "gm", "gn", "gp", "gq", "gr", "gs", "gt", "gu", "gw", "gy", "hk", "hm", "hn", "hr", "ht", "hu", "id", "ie", "il", "im", "in", "io", "iq", "ir", "is", "it", "je", "jm", "jo", "jp", "ke", "kg", "kh", "ki", "km", "kn", "kp", "kr", "kw", "ky", "kz", "la", "lb", "lc", "li", "lk", "lr", "ls", "lt", "lu", "lv", "l
package databaseProcesses;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class DatabaseConnector {
public Connection connection = null;
@boratanrikulu
boratanrikulu / install-go.sh
Last active November 6, 2020 10:43
Installs Go by installing GVM
#!/usr/bin/env bash
GO_VERSION="1.15"
die() {
echo "$*" >&2
exit 444
}
install_go() {
@boratanrikulu
boratanrikulu / postgresql_roles.markdown
Created August 31, 2019 18:04
Postgresql Config - Roles

Kamp sırasında genel olarak herkes Postgresql ile sorun yaşamıştı. Bunun için geçici bir yöntem olarak database.yml'de kullanıcı adı olarak postgres vermenizi söylemiştik. Fakat bu geçici bir yoldu.

Bunun için doğru çözüm, postgres'te, sistemde kullandığınız kullanıcı adı ile aynı isimde bir rol oluşturmak. Aşağıdaki gibi oluşturabilirsiz.

Role'ler hakkında kaynak: https://www.postgresql.org/docs/current/sql-createrole.html

Postgres ayakta değil ise kaldırın.

systemctl start postgresql

@boratanrikulu
boratanrikulu / blog_odev.markdown
Created July 30, 2019 12:24
Blog Ödevi Devamı

Blog Ödevi Devamı

  • Bir Article silindiğinde Comment'lerinde silinmesi sağlanmalı.
  • Article#Show'da Comment'lerin listelendiği bir kısım (direkt düz yazı olarak)
  • Comment ekle tuşu olcak. Comment tuşuna tıklandığında Comment yazma sayfasına gidilecek.
  • Comment oluşturulduğunda Article#Show'a geri gidilecek. JS kullanılmayacak.
 ------------------
@boratanrikulu
boratanrikulu / mvc.markdown
Last active July 29, 2019 15:36
MVC Nasıl Çalışır

MVC [Model, View, Controller]


             GET articles   --------
             ------------> | SERVER | >--------------------------------
            /               ---------                                  |
           /               my_wee_blog                                 |
          /                                                            |
 --------/                                                             |
| Client |                  - Article                                  |