Skip to content

Instantly share code, notes, and snippets.

View fatihtatoglu's full-sized avatar
🧪
Trying something new

Fatih Tatoğlu fatihtatoglu

🧪
Trying something new
View GitHub Profile
@fatihtatoglu
fatihtatoglu / main.go
Created May 28, 2023 09:36
Command & Event with Handlers
package main
import (
"encoding/json"
"fmt"
"log"
)
// Command represents an action to be performed by the server.
type Command struct {
delete
-----
- thunderbird
- rhythmbox
- transmission-gtk
- simple-scan
- timeshift
- libreoffice-impress
- libreoffice-draw
- Libreoffice-math
@fatihtatoglu
fatihtatoglu / workspace_sync.ps1
Last active September 24, 2021 07:17
GitHub Workspace sync script.
################################################################################
# Fatih Tatoğlu - https://github.com/fatihtatoglu
################################################################################
# Instructions
# 1. Copy this file
# 2. Create data.ini file
# 3. Execute script
################################################################################
# Example data.ini file
################################################################################
$url = "https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1"
$file = "$env:temp\ConfigureRemotingForAnsible.ps1"
(New-Object -TypeName System.Net.WebClient).DownloadFile($url, $file)
$currentPolicy = Get-ExecutionPolicy -List | Where-Object Scope -eq "LocalMachine" | Select-Object ExecutionPolicy
if ($currentPolicy -ne "Unrestricted") {
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force
}
$currentVersion = $PSVersionTable.PSVersion.Major
if ($currentVersion -ge 5) {
Write-Host "PowerShell is updated."
return
}
$url = "https://raw.githubusercontent.com/jborean93/ansible-windows/master/scripts/Upgrade-PowerShell.ps1"
$file = "$env:temp\Upgrade-PowerShell.ps1"
(New-Object -TypeName System.Net.WebClient).DownloadFile($url, $file)
@fatihtatoglu
fatihtatoglu / install-choco.ps1
Last active May 21, 2020 12:27
Creating Minimal Development Machine
Set-ExecutionPolicy Bypass -Scope Process -Force;
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'));
@fatihtatoglu
fatihtatoglu / seed.ps1
Created December 6, 2019 09:12
The development environment preparetion project seed.
function Initialize-Seed {
########################################
############## Chocolatey ##############
########################################
function Get-ChocolateyPath {
return $env:Path.Split(";", [System.StringSplitOptions]::RemoveEmptyEntries) | Select-Object $item | Where-Object { $_ -like "*choco*" }
}
function Test-Chocolatey {
$chocoPath = Get-ChocolateyPath