Skip to content

Instantly share code, notes, and snippets.

View j1n6's full-sized avatar
🎯
Focusing

Jing Dong j1n6

🎯
Focusing
View GitHub Profile
@j1n6
j1n6 / noop_sync.vbs
Last active August 29, 2022 09:37
Powershell to sync and push to remote git repository via Windows Scheduled Tasks
' Hack to workaround the Powershell Console popup running on a Windows Scheduled Task
' Powershell limitations: https://github.com/PowerShell/PowerShell/issues/3028
'
' Add this file in the same git root directory as the sync.ps1
'
Dim shell,command
Dim oFSO : Set oFSO = CreateObject("Scripting.FileSystemObject")
Dim sScriptDir : sScriptDir = oFSO.GetParentFolderName(WScript.ScriptFullName)
command = "powershell.exe -nologo -File " & sScriptDir & "\sync.ps1"
@j1n6
j1n6 / restore_glacier_to_s3.sh
Created March 23, 2015 14:56
recursively restore glacier file for a path
# You might get a couple of errors:
# 1. This is not Glacier type
# Restore is not allowed, as object's storage class is not GLACIER
# 2. Already requested
# Object restore is already in progress
# 3. This is a path object
# The specified key does not exist.
for key in `aws s3 ls --recursive s3://{BUCKET}/{PATH} | awk '{ print $4}'` ; do echo "==> $key"; aws s3api restore-object --bucket {BUCKET} --key $key --restore-request '{"Days": 1}' ; done
@j1n6
j1n6 / x11vnc.md
Created June 10, 2021 19:25
raspberry pi vnc auto start

steps: install and set password

  • sudo apt-get install x11vnc
  • x11vnc -storepasswd

create autostart entry

  • cd .config
  • mkdir autostart
  • cd autostart
* Lower Layer: Numpad
*
* .-------------------------------------------. .-------------------------------------------.
* | | F7 | F8 | F9 | F10 | | | / ? | 7 & | 8 * | 9 ( | - _ | |
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
* | | F4 | F5 | F6 | F11 | | | * | 4 $ | 5 % | 6 ^ | , < | + |
* |--------+------+------+------+------+------+ |------+------+------+------+------+--------|
* | | F1 | F2 | F3 | F12 | | | 0 ) | 1 ! | 2 @ | 3 # | = + | |
* '----------------------+------+------+------+ |------+------+------+----------------------'
* | | | | | | | |
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install dependencies
run: |
sudo apt-get update
package example.android.notepad.test;
import java.util.ArrayList;
import android.widget.ListView;
import com.example.android.notepad.NotesList;
import com.jayway.android.robotium.remotesolo.RemoteSolo;
import junit.extensions.TestSetup;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
require 'rspec'
describe "Behaviour" do
it "should pass" do
true.should eq true
end
it "should fail" do
true.should eq false
end
@j1n6
j1n6 / multiple_io.rb
Created January 3, 2014 12:55
Ruby Multiple IO
class MultipleIO
def initialize(*targets)
@targets = targets
end
def write(*args)
@targets.each { |t| t.write(*args) }
end
def close
This issue applies to: RHEL/CentOS 7.x and later
By default, firewalld will block intercontainer networking on the same docker host. To allow communication between the docker containers, run the following commands:
$ firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 4 -i docker0 -j ACCEPT