Skip to content

Instantly share code, notes, and snippets.

@toru2220
toru2220 / launch.json
Created April 5, 2020 14:29 — forked from philippslang/launch.json
VS Code pytest debugging settings
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: loadbalancer test",
"type": "python",
"request": "launch",
"module": "pytest",
"args": [
"--no-cov"
@toru2220
toru2220 / gist:024abddc391359a6aaced5ea3f89e562
Created July 5, 2019 20:40
Jenkins JobDSL Plugin switch enable/disable jobs setting
//DISABLED is jenkins parameter(boolean)
if(DISABLED.toBoolean())
{
disabled()
}
else
{
disabled(false)
}
@toru2220
toru2220 / gist:6ef242f24ea941949fce93b7a69e5175
Created July 2, 2019 15:18
ReadyNAS 104 repair volume command
btrfsck --force /dev/mdxxx
@toru2220
toru2220 / gist:805ab79acdf0cd1e2f997c3f6f93f5d7
Created June 24, 2019 09:55 — forked from mrtns/gist:78d15e3263b2f6a231fe
Upgrade Chrome from Command Line on Ubuntu
# Install
# via http://askubuntu.com/questions/510056/how-to-install-google-chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
# Update
@toru2220
toru2220 / gist:252446ffdf24ce36a1adc8729fb918e4
Created June 24, 2019 09:30
git-add-feature-brach-and-merge-to-master
git checkout -b (branch-name)
change source-code
git add * && git commit -m "changelog"
git push origin (branch-name)
git checkout master
git (branch-name)
git push
@toru2220
toru2220 / ToastNotification_Windows10.ps1
Created June 22, 2019 05:33 — forked from altrive/ToastNotification_Windows10.ps1
Windows 10 toast notification sample
$ErrorActionPreference = "Stop"
$notificationTitle = "Notification: " + [DateTime]::Now.ToShortTimeString()
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] > $null
$template = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastText01)
#Convert to .NET type for XML manipuration
$toastXml = [xml] $template.GetXml()
$toastXml.GetElementsByTagName("text").AppendChild($toastXml.CreateTextNode($notificationTitle)) > $null
@toru2220
toru2220 / build-jenkins-job.ps1
Created June 22, 2019 05:27
Jenkins Remote Build via PowerShell
$AllProtocols = [System.Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12'
[System.Net.ServicePointManager]::SecurityProtocol = $AllProtocols
$Auth = "username:token_or_password"
$Bytes = [System.Text.Encoding]::UTF8.GetBytes($Auth)
$Base64bytes = [System.Convert]::ToBase64String($Bytes)
$Headers = @{ "Authorization" = "Basic $Base64bytes"}
#Jenkins Job URL with TOKEN (disable CSRF)
$jenkinsurl_withtoken = "JENKINS_URL/job/JOB_NAME/build?token=TOKEN"
@toru2220
toru2220 / shell
Created January 20, 2017 21:08
Slack Post Image
curl -F file=@/path/to/image -F channels=general -F token=[TOKEN_NOT_WEBHOOK_URL] https://slack.com/api/files.upload
@toru2220
toru2220 / GlassFishEmbeddedSample.java
Created December 21, 2016 09:43
組み込みGlassFishのサンプル。v3.1でGlassFishRuntimeが加わった?
package samples.javaee;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import java.io.File;
import java.io.IOException;
import javax.annotation.Resource;
import javax.ejb.EJB;
@toru2220
toru2220 / ContextProfileInitializer.java
Created October 28, 2016 10:22 — forked from shimarin/ContextProfileInitializer.java
jettyで実行されてる時だけ組み込みデータベースを用い、それ以外の時はJNDIを引いてくる Spring Webアプリケーション
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.web.context.ConfigurableWebApplicationContext;
public class ContextProfileInitializer
implements ApplicationContextInitializer<ConfigurableWebApplicationContext> {
public void initialize(ConfigurableWebApplicationContext ctx) {
String profiles = "prod";
if (ctx.getServletContext().getServerInfo().startsWith("jetty")) {
profiles = "dev";