A repository of Git commands I find useful.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| echo "==== rename.sh ===== | |
| This script recurses through videos in a folder, and | |
| renames them into a format as follows: | |
| test_[w]x[h]_[bitrate]_[duration].[extension] | |
| e.g. | |
| test_640x480_2973Kbps_34s.mov |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ###################################### | |
| # get and set network connection | |
| ###################################### | |
| # returns 1 if airplane mode is enabled, 0 otherwise. | |
| adb -s $DEVICE_ID shell settings get global airplane_mode_on | |
| # the same for wifi and mobile data. | |
| adb -s $DEVICE_ID shell settings get global wifi_on | |
| adb -s $DEVICE_ID shell settings get global mobile_data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 2016-03-10 11:58:34:740 - info: Welcome to Appium v1.4.13 (REV c75d8adcb66a75818a542fe1891a34260c21f76a) | |
| 2016-03-10 11:58:34:742 - info: Appium REST http interface listener started on 127.0.0.1:4723 | |
| 2016-03-10 11:58:34:745 - debug: Non-default server args: {"app":"D:\\vish\\ma-app-verification-android\\appium-projects\\AppiumAndroid\\CrunchAPKs\\Crunch.apk","udid":"ZX1B33GSLN","address":"127.0.0.1","log":"C:\\Users\\vish\\AppData\\Local\\Temp\\appium4723.log","loglevel":"warn:debug","localTimezone":true,"androidPackage":"com.icelero.crunch","androidWaitActivity":"app.CrunchSplashActivity","deviceName":"MotoE","platformName":"Android","platformVersion":"5.1","automationName":"Appium","chromeDriverPort":4725,"chromedriverExecutable":"C:\\Users\\vish\\AppData\\Local\\Temp\\\\chromedriver.exe","defaultCommandTimeout":600} | |
| 2016-03-10 11:58:34:745 - info: Console LogLevel: warn | |
| 2016-03-10 11:58:34:745 - info: File LogLevel: debug | |
| 2016-03-10 11:58:35:620 - info: --> GET /wd/hub/status {} | |
| 2016-03-10 11:58:35:622 - de |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [testng] org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. (Original error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "D:\vish\adt-bundle\sdk\platform-tools\adb.exe shell "settings get global airplane_mode_on"" | |
| [testng] error: more than one device/emulator | |
| [testng] ) (WARNING: The server did not provide any stacktrace information) | |
| [testng] Command duration or timeout: 43 milliseconds | |
| [testng] Build info: version: 'unknown', revision: 'unknown', time: 'unknown' | |
| [testng] System info: host: 'freeman', ip: '10.0.0.119', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_25' | |
| [testng] Driver info: io.appium.java_client.android.AndroidDriver | |
| [testng] Capabilities [{appPackage=com.icelero.crunch, networkConnectionEnabled=true, warnings={}, databaseEnabled=false, deviceName=MotoE, uuid=ZX1B33GSLN, platform=LINUX, appActivity=app.CrunchSplashActivity, chromedriverExecutable=C:\Users\vish\AppData\Loca |
Background: I had previously SSH'd into a server and CD to directory /opt/foo when I got kicked out by network troubles. A colleague was trying to delete that directory and could not delete it.
- SSH into the server
- Execute
whoto get the active sessions. - Try to locate the
pts/Nsession from the list. - Now execute
ps -ef | grep -i sshdand from the list, locate the PID for the SSHD session that haspts/N.
NewerOlder