Skip to content

Instantly share code, notes, and snippets.

View tsarenkotxt's full-sized avatar
💻

Andrii Tsarenko tsarenkotxt

💻
  • Ukraine
View GitHub Profile
@kaloprominat
kaloprominat / macos: manage add list remove login items apple script
Last active April 11, 2025 22:26
macos: manage add list remove login items apple script
# applescript
# add login item
osascript -e 'tell application "System Events" to make login item at end with properties {name: "Notes",path:"/Applications/Notes.app", hidden:false}'
# delete login item
osascript -e 'tell application "System Events" to delete login item "itemname"'
# list loginitems
osascript -e 'tell application "System Events" to get the name of every login item'
@rxaviers
rxaviers / gist:7360908
Last active June 20, 2025 01:12
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@kaloprominat
kaloprominat / os x: python get currently logged user
Last active March 13, 2022 10:14
os x: python get currently logged user
#python and system configuration framework
loggedInUser=`python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");'`
# dev console owner (_mbsetup user stable)
stat -f '%Su' /dev/console
# scutil
echo "show State:/Users/ConsoleUser" | scutil
# loginwindow plist (last means last, fails with multiuser sessions)
@gene1wood
gene1wood / all_aws_lambda_modules_python.md
Last active January 28, 2025 09:47
AWS Lambda function to list all available Python modules for Python 2.7 3.6 and 3.7
@kaitoy
kaitoy / TcpReassembler.java
Last active August 21, 2021 21:10
An example implementation of TCP reassembler
import java.io.EOFException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeoutException;
import org.pcap4j.core.BpfProgram.BpfCompileMode;
import org.pcap4j.core.NotOpenException;
@0xjac
0xjac / private_fork.md
Last active June 17, 2025 20:41
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@i-sannikov
i-sannikov / LoadModule.java
Created January 23, 2018 11:55
JAVA9 load module in runtime
import java.lang.module.ModuleFinder;
import java.lang.module.ModuleReference;
import java.lang.reflect.Method;
import java.util.Optional;
public class LoadModule {
public static void main(String[] args) throws Exception {
load("java.activation");
}
@mraaroncruz
mraaroncruz / steps.md
Last active May 16, 2025 16:40
Get the Telegram channel ID

To get the channel id

  1. Create your bot with botfather
  2. Make you bot an admin of your channel

Simplest way (via @anhtuank7c)

Go to Telegram web and open a channel, get the ID from -[channel id] from hash in the path

https://web.telegram.org/k/#-9999999999999

@joshkautz
joshkautz / Replace TextEdit as the default macOS text editor.md
Last active January 6, 2025 02:09
Replace TextEdit as the default text editor

Replace TextEdit as the default text editor application for opening plain text files and files with no extensions on macOS.

Run the following command in the Terminal to find the bundle identifier for your desired text editor application:

$ osascript -e 'id of app "Visual Studio Code"'
com.microsoft.VSCode

$ osascript -e 'id of app "Sublime Text"'
com.sublimetext.3