Skip to content

Instantly share code, notes, and snippets.

View omergulen's full-sized avatar
🚩
pushing the limits

Ömer omergulen

🚩
pushing the limits
View GitHub Profile
@omergulen
omergulen / deploy.yml
Created April 2, 2024 07:47
SSH Deploy
name: Node CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@omergulen
omergulen / cwl-last-used.sh
Created December 2, 2022 15:03 — forked from jsyi/cwl-last-used.sh
Use AWS CLI to query AWS CloudWatch Logs and determine the most recent entry into a Log Group
aws logs describe-log-groups | jq ".logGroups[].logGroupName" | grep -E "homeplus|mcdonalds" | xargs -n 1 -t aws logs describe-log-streams --query "logStreams[*].lastEventTimestamp" --log-group | jq "max/1000|floor" | xargs -t -n 1 date -r
# aws logs describe-log-groups | jq ".logGroups[].logGroupName"
# Get LogGroup names
# grep -E "homeplus|mcdonalds"
# (Optional) Filter LogGroup names
# xargs -n 1 -t aws logs describe-log-streams --query "logStreams[*].lastEventTimestamp" --log-group | jq "max/1000|floor"
# Get last event timestamp for each LogGroup.
@omergulen
omergulen / hook_printer_telegram.php
Created July 19, 2019 10:36
Get post request and it's body with Telegram message on PHP Server.
<?php
$_POST = (array) json_decode(file_get_contents('php://input'));
define('API_KEY','BOT_API_TOKEN');
define('CHAT_ID','YOUR_CHAT_ID');
function make_req($method, $datas=[]) {
$url = "https://api.telegram.org/bot" . API_KEY . "/" . $method;
$ch = curl_init();
@omergulen
omergulen / Manager.swift
Created March 24, 2019 16:07
Manager WWDC19
import Foundation
import UIKit
public class Manager: UIViewController {
var containerView = UIView()
public override func loadView() {
initUIView()
self.view = containerView

How to setup Shadowsocks on your Ubuntu server

Your school or company network may block the access to a few specific websites. To solve this problem, I'd highly recommend Shadowsocks, since it is the easiest proxy tool I've ever found, and it's FREE (of course iff you have your own server running).

First, ssh to your server, and make sure you have Python and pip installed. If you have Python but not pip, install it using the following command

$ sudo apt-get install python3-pip
@omergulen
omergulen / manifest_ss_share.xml
Created July 13, 2018 14:55
manifest_ss_share.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.soguk_savas">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="false"
@omergulen
omergulen / ss_share.js
Last active July 13, 2018 12:57
Screenshot share code
import React, { Component } from 'react';
import { View, Text, StyleSheet, TouchableHighlight } from 'react-native';
import ViewShot from "react-native-view-shot";
import Share from 'react-native-share';
export default class Yonler extends Component {
constructor(props){
super(props);
...
}