Skip to content

Instantly share code, notes, and snippets.

View ahmadronaghdev's full-sized avatar

AhmadRonagh ahmadronaghdev

  • Tehran
View GitHub Profile
@ahmadronaghdev
ahmadronaghdev / setup-kubernetes-ubuntu-16.md
Created September 11, 2018 11:42 — forked from ruanbekker/setup-kubernetes-ubuntu-16.md
Install a 3 Node Kubernetes Cluster on Ubuntu 16

Master: Dependencies

apt update && apt upgrade -y
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -

cat <<EOF > /etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@ahmadronaghdev
ahmadronaghdev / pip3-python3-ubuntu.md
Created June 30, 2018 07:05 — forked from diegopacheco/pip3-python3-ubuntu.md
How to Install pip3 on python3 Ubuntu 16.04
sudo apt-get install python3-setuptools
sudo easy_install3 pip
@ahmadronaghdev
ahmadronaghdev / example.ocserv.conf
Created May 5, 2018 21:50 — forked from luginbash/example.ocserv.conf
Example OpenConnect Server configuration
auth = "plain[/etc/ocserv/ocpasswd]"
max-clients = 16
max-same-clients = 5
tcp-port = 443
udp-port = 443
keepalive = 32400
dpd = 90
mobile-dpd = 1800
try-mtu-discovery = true
server-cert = /etc/ssl/certs/server-cert.pem
@ahmadronaghdev
ahmadronaghdev / Dagger2SimpleExample.java
Created March 18, 2018 07:17 — forked from vestrel00/Dagger2SimpleExample.java
A: Dagger.android 2.11 simple example with support for Singleton, PerActivity, PerFragment, and PerChildFragment scopes
// This is a super simplified example of how to use the new dagger.android framework
// introduced in Dagger 2.10. For a more complete, in-depth guide to dagger.android
// read https://proandroiddev.com/how-to-android-dagger-2-10-2-11-butterknife-mvp-part-1-eb0f6b970fd
// For a complete codebase using dagger.android 2.11/2.12/2.13/2.14, butterknife 8.7/8.8, and MVP,
// see https://github.com/vestrel00/android-dagger-butterknife-mvp
// This example works with Dagger 2.11/2.12/2.13/2.14. Starting with Dagger 2.11,
// @ContributesAndroidInjector was introduced removing the need to define @Subcomponent classes.
@ahmadronaghdev
ahmadronaghdev / activity_main.xml
Created February 5, 2018 19:13 — forked from granoeste/activity_main.xml
[Android] Glossy gradient button
<Button
android:id="@+id/button1"
style="@style/GlossyGradientButtonStyle"
android:layout_width="wrap_content"
android:layout_height="@dimen/button_height"
android:minWidth="100dp"
android:text="OK" />
<Button
android:id="@+id/button2"
Reset Permission
adb shell pm reset-permissions your.package.name
Grant And Revoke Permission
adb shell pm [grant|revoke] com.my.app android.permission.ACCESS_FINE_LOCATION
@ahmadronaghdev
ahmadronaghdev / AndroidManifest.xml
Created October 25, 2017 07:35 — forked from ckurtm/AndroidManifest.xml
Example on how to use adb to start an Activity,BroadcastReceiver or Service from adb and include intent extras too. for Activity: adb shell am start -n "com.peirr.test/com.peirr.test.MyActivity" --es name "John" --ei age 30 for BroadcastReceiver adb shell am broadcast -n "com.peirr.test/com.peirr.test.MyReceiver" --es name "John" --ei age 30 for…
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.peirr.test">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
@ahmadronaghdev
ahmadronaghdev / android_studio_shortcuts.md
Created October 3, 2017 08:30 — forked from stkent/android_studio_shortcuts.md
Android Studio Shortcuts (Mac)

Android Studio Shortcuts (Mac)

Notes:

  • Two of the most useful shortcuts utilize the Fn (function) keys. It is therefore recommended that you enable the "Use all F1, F2, etc. keys as standard function keys" option [System Preferences > Keyboard].
  • Be sure to enable the Mac OS X 10.5+ keymap in Android Studio [Preferences > Keymap].
  • A fairly complete shortcut list can be found here.

Useful symbols:

@ahmadronaghdev
ahmadronaghdev / 32.asm
Created September 28, 2017 07:16 — forked from FiloSottile/32.asm
NASM Hello World for x86 and x86_64 Intel Mac OS X (get yourself an updated nasm with brew)
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32
global start
section .text
start:
push dword msg.len
push dword msg
push dword 1
mov eax, 4