Skip to content

Instantly share code, notes, and snippets.

for iommu_group in $(find /sys/kernel/iommu_groups/ -maxdepth 1 -mindepth 1 -type d); do
echo "IOMMU group $(basename "$iommu_group")";
for device in $(ls -1 "$iommu_group"/devices/); do echo -n $'\t'; lspci -nns "$device";
done;
done
@cnra
cnra / samba-share.conf
Created July 31, 2019 20:48
samba share definations
======================= Share Definitions =======================
Un-comment the following (and tweak the other settings below to suit)
to enable the default home directory shares. This will share each
user's home directory as \server\username
[Paylasimlar]
path = /home
browsable =yes
writable = yes
guest ok = yes
@cnra
cnra / tltp.mq5
Last active August 6, 2019 22:00
metatrader 5 take profit / stop loss
input int SL = 150; //15 pip
void OnTradeTransaction(const MqlTradeTransaction &txs, const MqlTradeRequest &req, const MqlTradeResult &res)
{
MqlTradeRequest rq={0};
MqlTradeResult tr;
if (HistoryDealGetInteger(txs.deal, DEAL_ENTRY) == DEAL_ENTRY_IN)
{
PositionSelect(txs.symbol);
rq.position = txs.order;
@cnra
cnra / .gitignore
Created October 11, 2019 11:13
unity gitignore
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
[Bb]uilds/
[Ll]ogs/
# Uncomment this line if you wish to ignore the asset store tools plugin
# [Aa]ssets/AssetStoreTools*
@cnra
cnra / minesweeper.cs
Created October 12, 2019 21:54
mayın tarlası minesweeper from https://www.youtube.com/watch?v=01XtKAVS6-s
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using Minesweeper.Properties;
namespace Minesweeper
{
public partial class MinesweeperForm : Form
@cnra
cnra / docker1.sh
Created October 13, 2019 10:59
windows docker volume trick
c1="docker run -it --rm -d -p 3000:80 -v `pwd`:/usr/share/nginx/html nginx"
echo ${c1}
docker-machine ssh default "${c1}"
@cnra
cnra / docker-compose.yml
Created October 14, 2019 01:58
basic docker compose example
version: '3'
services:
web:
container_name: nginx_image
image: nginx
volumes:
- .:/usr/share/nginx/html
ports:
- '3000:80'
@cnra
cnra / docker-compose.yml
Created October 15, 2019 18:43
wordpress docker compose
version: '3'
services:
db:
image: mysql:5.7
restart: always
volumes:
- db_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: password
@cnra
cnra / statsapi-logzio.js
Created January 5, 2020 15:45
logz io stats api
const express = require('express')
var bodyParser = require("body-parser");
require('express-async-errors');
var port = process.env.PORT || 3010
const app = express()
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
@cnra
cnra / statsapi-unity-logzio.cs
Last active January 5, 2020 19:27
unity logz ip stat gönderme
// ornek istatistik fonksiyonu diger scriptlerden cagrilacak
public void SendNewScore(int score, float time)
{
// statlar dictionary olarak hazirlaniyor
var eventData = new Dictionary<string, object> {
{ "guid", Prefs.Guid},
{ "guidsub", Prefs.GuidSub},
{ "sessionid", _sessionId},
{ "nick", Prefs.ServerNick },