Skip to content

Instantly share code, notes, and snippets.

@Ertavf
Ertavf / Get-CombinedVideoChapters.ps1
Last active June 17, 2023 00:56
This PowerShell code is designed to gather information about Video files in a specified folder using the ffprobe tool. # It generates a table containing details such as the file name, modified date, duration, and jump location. # The jump location indicates the start time of each MKV file in the combined video.
function Get-MkvFileInfo {
# This PowerShell code is designed to gather information about Video files in a specified folder using the ffprobe tool.
# It generates a table containing details such as the file name, modified date, duration, and jump location.
# The jump location indicates the start time of each MKV file in the combined video.
# https://chat.openai.com/share/4210cce5-0d4d-4bc9-aa1f-a8fe072a3052
param(
[string]$ffprobeCmd = 'ffprobe',
[string]$folderPath = $([Environment]::GetFolderPath([Environment+SpecialFolder]::MyVideos))
)
@Ertavf
Ertavf / opening-up-a-port-with-powershell.ps1
Created May 5, 2023 20:41
opening-up-a-port-with-powershell.ps1
# https://stackoverflow.com/questions/13129060/opening-up-a-port-with-powershell
Clear-Host; $VerbosePreference="Continue"; $Port=23
$EndPoint=[System.Net.IPEndPoint]::new([System.Net.IPAddress]::Parse("0.0.0.0"),$Port)
$Listener=[System.Net.Sockets.TcpListener]::new($EndPoint)
$KeepListening=$true
while ($KeepListening) {
$Listener.Start()
while (!$Listener.Pending) { Start-Sleep -Milliseconds 100 }
@Ertavf
Ertavf / Create a new firewall rule for each port.ps1
Created May 5, 2023 14:06
Create a new firewall rule for each port
# Define the ports to open
$ports = @(5432)
# Create a new firewall rule for each port
foreach ($port in $ports) {
$rule = New-NetFirewallRule -DisplayName "Port $port" -Direction Inbound -Protocol TCP -LocalPort $port -Action Allow
Write-Host "Created firewall rule for port $port"
}
@Ertavf
Ertavf / powershell remove files with specific pattern.ps1
Created May 5, 2023 14:02
powershell remove files with specific pattern
$regex = "\s\(\d+\)\."
$a = Get-ChildItem -Path . -Recurse | Where-Object { $_.Name -match $regex }
$a | Remove-Item -Confirm
#!/bin/bash
<<nedirkibu
webde ara: https://www.google.com/search?q=remote+ssh
webde ara: https://shell.cloud.google.com/
yukle: https://cloud.google.com/sdk/docs/install
$HOME/.ssh/config dosyani olustur, benimkisi boyle:
Host gcp
HostName "34.147.23.251"
# "According to company rules, a bus can only have three seats. To replace seat 29, you have to buy seat 19, 25."
# As a result of having trouble getting a bus ticket from a company that says the above
# I wrote this script to be notified when someone else buys a ticket.
# get
Function GetResponse() {
$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession
# removed cookies
@Ertavf
Ertavf / main.dart
Created February 9, 2022 02:34 — forked from chalin/main.dart
Language Tour: Anonymous Function
void main() {
var list = ['apples', 'bananas', 'oranges'];
list.forEach((item) {
print('${list.indexOf(item)}: $item');
});
}
@Ertavf
Ertavf / README.MD
Created February 8, 2022 09:59 — forked from RichardBronosky/README.MD
cb - A leak-proof tee to the clipboard - Unify the copy and paste commands into one intelligent chainable command.

cb

A leak-proof tee to the clipboard

This script is modeled after tee (see [man tee][2]) and works on Linux, macOS, Cygwin, WSL/WSL2

It's like your normal copy and paste commands, but unified and able to sense when you want it to be chainable.

This project started as an answer to the StackOverflow question: [How can I copy the output of a command directly into my clipboard?][3]

@Ertavf
Ertavf / designer.html
Created November 25, 2014 21:36
designer
<link rel="import" href="../ace-element/ace-element.html">
<link rel="import" href="../chart-js/chart-js.html">
<link rel="import" href="../paper-calculator/paper-calculator.html">
<link rel="import" href="../topeka-elements/topeka-resources.html">
<link rel="import" href="../topeka-elements/topeka-leaderboard.html">
<link rel="import" href="../topeka-elements/theme.html">
<link rel="import" href="../topeka-elements/topeka-app.html">
<link rel="import" href="../topeka-elements/topeka-datasource.html">
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">