Showing posts with label using. Show all posts
Showing posts with label using. Show all posts

Tuesday, September 26, 2017

Streaming log or Tail log using Notepad

Streaming log or Tail log using Notepad


Notepad++ has the feature to update the file/log silently like "tail -f" in linux.

1. Select the Setting -> Preferences..



2. In the MISC tap select "Update silently" and "Scroll to the last line after update" option under "File Status Auto-Detection" part.


Other Alternative windows applications
  • Tail for Win32
  • Baretail




download file now

Read more »

Tuesday, September 19, 2017

Stream your webcam to see it through a browser using YawCam

Stream your webcam to see it through a browser using YawCam


YawCam

YawCam, Yet Another Webcam software, this is a free program that, unlike tons of others, will let you easy stream your webcam to see it through your browser.

Now, let�s do this. First download and install.

Let�s configure it. First you need to select the cam you want to use.

YawCam Setting

Now, go to Settings > Edit settings. Copy your public IP and port.

YawCam connection

Now (assuming that you already forwarded the port, otherwise use this) enable the Stream option.

YawCam streaming

Go to the browser and paste the IP followed by the port, like this:

xxx.xxx.xxx.xxx:PORT

Where xxx.xxx.xxx.xxx is your public IP, and PORT is the port that the program is using.

IP

And that�s it. You�ll receive a notification each time someone is watching you. Also, you need to keep the program running to be able to access it, so if you shut it down, no one will be able to access your camera.


download file now

Read more »

Sunday, September 3, 2017

Swipe to Refresh ListView using SwipeRefreshLayout

Swipe to Refresh ListView using SwipeRefreshLayout



With android.support.v4.widget.SwipeRefreshLayout, user can refresh the contents of a view via a vertical swipe gesture. This example show how to implement Swipe-to-Refresh ListView using SwipeRefreshLayout.


activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout

android_layout_width="match_parent"
android_layout_height="match_parent"
android_padding="16dp"
android_orientation="vertical"
tools_context="com.blogspot.android_er.androidswiperefresh.MainActivity">

<TextView
android_layout_width="wrap_content"
android_layout_height="wrap_content"
android_layout_gravity="center_horizontal"
android_autoLink="web"
android_text="http://android-er.blogspot.com/"
android_textStyle="bold" />

<android.support.v4.widget.SwipeRefreshLayout
android_id="@+id/swiperefreshlayout"
android_layout_height="match_parent"
android_layout_width="match_parent">
<ListView
android_id="@+id/swipelist"
android_layout_width="match_parent"
android_layout_height="match_parent"/>
</android.support.v4.widget.SwipeRefreshLayout>

</LinearLayout>


MainActivity.java
package com.blogspot.android_er.androidswiperefresh;

import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.widget.ArrayAdapter;
import android.widget.ListAdapter;
import android.widget.ListView;

import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class MainActivity extends AppCompatActivity {

SwipeRefreshLayout swipeRefreshLayout;
ListView swipeList;

List<String> myList;
ListAdapter adapter;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

swipeRefreshLayout = (SwipeRefreshLayout)findViewById(R.id.swiperefreshlayout);
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
refresh();
}
});

swipeList = (ListView)findViewById(R.id.swipelist);

myList = new ArrayList<>();
adapter = new ArrayAdapter<String>(
this, android.R.layout.simple_list_item_1, myList);
swipeList.setAdapter(adapter);
}

private void refresh(){
//insert dummy string of current date/time
String currentDateTime = DateFormat.getDateTimeInstance().format(new Date());
myList.add(currentDateTime);
swipeList.invalidateViews();
swipeRefreshLayout.setRefreshing(false);
}
}


In this example, the ListView items is updated in SwipeRefreshLayout.OnRefreshListener(). But normally refreshing involve longtime task, such as loading from Internet. The next example show how to refresh with longtime task run in background thread.


download file now

Read more »

Thursday, August 31, 2017

Stream Videos To Chromecast From The Command Line Using Stream2Chromecast

Stream Videos To Chromecast From The Command Line Using Stream2Chromecast



Stream2Chromecast is a command line Chromecast media streamer for Linux. The tool can transcode unsupported formats in real time and play them on the Chromecast.

Those who prefer a GUI for for streaming videos to Chromecast can use Videostream for Google Chromecast, a Chrome extension that allows playing local videos (including formats that arent directly supported by Chromecast) on your Chromecast. It supports subtitles, comes with iOS and Android remote controls, and more.


Stream2Chromecast features:
  • cast audio and video to a Chromecast device;
  • pass an URL to be played on the Chromecast; the file must be streamable and a Chromecast supported format since it cant be transcoded;
  • can transcode any formats not supported by the Chromecast in real time (using FFmpeg or Libav), so you dont have to convert any video manually;
  • provides basic control commands: pause / unpause / stop playback (currently this only works when not transcoding), set or mute volume;
  • allows specifying a device when multiple Chromecasts are connected on the same network;
  • supports passing custom custom transcoder parameters to ffmpeg or avconv (thanks to this, you can set the quality, add subtitles even though Stream2Chromecast doesnt directly support it, etc.);
  • supports specifying the port to use for streaming media.

For audio-only files, no metadata (artist, title, cover image, etc.) is displayed by Chromecast.

You may be wondering how Stream2Chromecast compares to castnow, another command-line Chromecast player. 

I initially wanted to write about both castnow and Stream2Chromecast. However, castnow had quite a few issues in my test under Ubuntu 16.04, such as stuttering playback for MKV files, subtitles didnt work with the "--tomp4" flag (which transcodes the video to MP4), and more.

Furthermore, castnow is currently looking for a new maintainer, and its last GitHub commit dates back to April, 2016, so it doesnt look like it will receive any improvements or bug fixes anytime soon.


Basic Stream2Chromecast usage


Notes:
  • the instructions below assume youve installed Stream2Chromecast from the main WebUpd8 PPA (see the installation instructions below). If you install Stream2Chromecast manually, youll need to use the full path to stream2chromecast.py (e.g.: "/path/to/stream2chromecast.py /path/to/my_media.mp4") for the commands below;
  • the computer running Stream2Chromecast and the Chromecast device must be in the same network;
  • ffmpeg or libav-tools are required for transcoding. If both are installed, ffmpeg is used by default.

To stream a supported media file (you can find a list of the media supported by Google Cast, HERE)
 to your Chromecast, simply use the following command:
stream2chromecast "/path/to/some-video.mp4"
Replacing "/path/to/some-video.mp4" with the exact path and filename of the video you want to play (e.fg.: stream2chromecast "/home/andrei/Videos/VIDEO1.mp4").

In my test, Stream2Chromecast failed to connect to my Chromecast if I didnt specify the Chromecast IP address, while other tools, such as pulseaudio-dnla, didnt have this issue, so Im guessing this is a bug.

If thats the case for you too, you can specify the Chromecast IP by adding the "-devicename" flag followed by the Chromecast IP address, to the stream2chromecast command, like this:
stream2chromecast -devicename CHROMECAST_IP_ADDRESS "/path/to/some-video.mp4"
Where "CHROMECAST_IP_ADDRESS" is the Chromecast IP address. You can find out your Chromecast IP address either by looking at your routers connected devices list or from the Google Cast mobile app, under "Device settings", under "Information" (at the bottom of the Device Settings).

Note that if youre having the same issue as me, and you need to enter the device IP address, you must do this for all Stream2Chromecast commands!

In the same way, you can also specify the Chromecast name:
stream2chromecast -devicename CHROMECAST_NAME "/path/to/some-video.mp4"

If you want to play an unsupported format (you can find a list of the media supported by Google Cast, HERE) on your Chromecast, you need to add the "-transcode" flag and have either Libav or FFmpeg installed:
stream2chromecast -transcode "/path/to/some-video.avi"
Where "/path/to/some-video.avi" is the exact path and filename of the media file you want to play on your Chromecast. You can append other flags to this command, like "-devicename CHROMECAST_IP_ADDRESS", which Ive mentioned above.

Stream2Chromecast also supports specifying custom transcoder parameters. As an example, heres a command that passes the device IP address, transcodes the video, and adds subtitles via a custom FFmpeg parameter (for FFmpeg only):
stream2chromecast -devicename CHROMECAST_IP_ADDRESS -transcodeopts -vf subtitles="/path/to/some-video.srt" -transcode "/path/to/some-video.avi"
Where CHROMECAST_IP_ADDRESS is your Chromecast IP address, "/path/to/some-video.avi" is the exact path and filename of the video you want to play on the Chromecast, and "/path/to/some-video.srt" is the exact subtitle path and filename of the subtitle file you want to use.

More about the FFmpeg subtitle filters, HERE.

Update: the app now allows playing a supported file from an URL (the file must be streamable and cannot be transcoded). To play a file from an URL, simply use:
stream2chromecast -playurl URL
Where URL is the video file URL, e.g. "http://www.example.com/my_media.mp4".

To stop stream2chromecast from streaming, either press Ctrl + C in the terminal where you ran the Stream2Chromecast (sometimes this can throw an exception / error - ignore it), or run the following command in a different terminal window:
stream2chromecast -stop

To view all the Stream2Chromecast options, run it in a terminal without any parameters:
stream2chromecast
Or visit the Stream2Chromecast GitHub page.


Download / Install Stream2Chromecast


Ubuntu 16.04 and 14.04 / Linux Mint 18 or 17.x users can install Stream2Chromecast by using the main WebUpd8 PPA. Add the PPA and install it using the following commands:
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt update
sudo apt install stream2chromecast

If you dont want to add the PPA or you dont use Ubuntu, you can grab the deb from HERE or download Stream2Chromecast from GitHub (either via Git or by downloading the latest code as a .tar.gz archive - HEREs a direct link).

Report any bugs you may find @ GitHub.

Also see: How To Stream Audio To A Chromecast Or DLNA / UPnP Device From Linux (Using pulseaudio-dnla)

Thanks to Mahdi for the tip! Image via Wikipedia.

download file now

Read more »

Wednesday, August 9, 2017

Subscribe Google Apps users to calendars using GAM and python

Subscribe Google Apps users to calendars using GAM and python


If you want to subscribe a Google App user to calendar, you can use GAM and python. This following script my get you started:



Note: You have to have GAM up and running before running this script.

download file now

Read more »