Posts

Showing posts with the label Terminal

Android - Can I Restart Bluetooth From The Terminal?

Answer : The following terminal command should enable Bluetooth via adb shell or Terminal Emulator app: su am start -a android.bluetooth.adapter.action.REQUEST_ENABLE On most versions of Android, this command will present a pop-up window to the user asking to confirm request to enable BT. I believe this was done for security purposes whenever an app that is not system is toggling BT. I haven't found a way to disable BT via a shell command unfortunately. With WiFi it's a lot easier, and does not prompt user for permission: su svc wifi enable will turn it on, and su svc wifi disable will turn it off. in android.bluetooth.IBluetoothManager, there some parameters TRANSACTION_registerAdapter = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); TRANSACTION_unregisterAdapter = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); TRANSACTION_registerStateChangeCallback = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); TRANSACTION_unregisterStateChangeCallback...

Apple - Alternative To TotalTerminal That Works With El Capitan

Answer : If you're willing to disable System Integrity Protection to continue using TotalTerminal, you can do that. If not, the developer of TotalTerminal says the reason he stopped working on it is that he switched to iTerm 2, which he says "offers similar functionality to Visor and comparable features to build-in [sic] Terminal.app." I've never used either, but another question on this site explains how to set up iTerm to work in a similar manner.

Adb Command Not Found

Answer : In my case with Android Studio 1.1.0 path was this /Users/wzbozon/Library/Android/sdk/platform-tools Add the following to ~/.bash_profile export PATH=~/Library/Android/sdk/tools:$PATH export PATH=~/Library/Android/sdk/platform-tools:$PATH Is adb installed? To check, run the following command in Terminal: ~/Library/Android/sdk/platform-tools/adb If that prints output, skip these following install steps and go straight to the final Terminal command I list: Launch Android Studio Launch SDK Manager via Tools -> Android -> SDK Manager Check Android SDK Platform-Tools Run the following command on your Mac and restart your Terminal session: echo export "PATH=~/Library/Android/sdk/platform-tools:$PATH" >> ~/.bash_profile Note: If you've switched to zsh, the above command should use .zshenv rather than .bash_profile Make sure adb is in your user's $PATH variable. or You can try to locate it with whereis and run it wit...

Copy / Paste Text Selections Between Tmux And The Clipboard

Answer : Use the following tmux.conf with copy-pipe in the new versions of tmux (1.8+): set -g mouse on # To copy: bind-key -n -t emacs-copy M-w copy-pipe "xclip -i -sel p -f | xclip -i -sel c " # To paste: bind-key -n C-y run "xclip -o | tmux load-buffer - ; tmux paste-buffer" prefix+[ into copy-mode select content with mouse(hold) M-w to copy that part into system clipboard C-y the paste it inside tmux, C-v to paste it inside other regular application like web browser. Please note that, with Tmux 2.4 (since this commit), the binding syntax has changed. I paraphrase this Github comment to summarise the change briefly: replace -t with -T replace vi-<name> with <name>-mode-vi prefix the command with send-keys -X I had: bind-key -n -t vi-copy Enter copy-pipe 'xclip -i -sel p -f | xclip -i -sel c' bind-key -n -t vi-copy MouseDragEnd1Pane copy-pipe 'xclip -i -sel p -f | xclip -i -sel c' which I needed to change to: bind-key -n -T ...

Console/Terminal Widget For Qt?

Answer : QConsole used to do something like that. (Not sure the project is active anymore, but you might want to have a look). Found some decent source code here. Very basic functionality, but I've been adding to it some and I think it has promise to do what I need it to. NOTE: I have only tested this code in Win32. Here is a link to my new question concerning this code.

Add Pygame Module In PyCharm IDE

Answer : Well, you don't have to download it for PyCharm here. You probably know how it checks your code. Through the interpreter! You don't need to use complex command lines or anything like that. You need to is: Download the appropriate interpreter with PyGame included Open your PyCharm IDE (Make sure it is up to date) Go to File Press Settings (Or Ctrl + Alt + S) Double click on the option that looks like Project: Name_of_Project Click on Project Interpreter Choose the interpreter you want to use that includes PyGame as a module Save your options And you are ready to go! Here is an alternate (I have never done this, please try to test it) Add PyGame in the same folder as your PyCharm file (Your PyCharm stuff is always in a specific file placed by you during installation/upgrade) Please consider putting your PyCharm stuff inside a folder for easy access. I hope this helps you! For PyCharm 2017 do the following: File - Settings Double click on y...