2021年3月9日 星期二

超簡單安裝步驟 Docker-runner on VM(照著做就可以)

 首先,安裝或選擇 Debian 系統完成後,
(硬碟空間記得要夠,寫這篇文章的時候,10G應該就夠了,但未來不確定)

打開虛擬機:

2020年1月9日 星期四

Redmine 收信 相關資訊


Redmine wiki
https://www.redmine.org/projects/redmine/wiki

官網安裝文章
https://www.redmine.org/projects/redmine/wiki/RedmineInstall

對了,自己安裝前請先確認有沒有安裝Ruby~~
https://www.ruby-lang.org/zh_tw/documentation/installation/

===================================================

Windows 安裝
https://blog.miniasp.com/post/2011/12/27/Install-Redmine-on-Windows-Notes
Ubuntu 安裝
https://rickhw.github.io/2019/05/11/Redmine/Install-Redmine40x-on-Ubuntu1604/

Ubuntu 切換使用者 su [account]   (switch user的意思)

一鍵安裝的方案
https://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/435522/

Docker方案
https://github.com/sameersbn/docker-redmine
https://hub.docker.com/_/redmine

啟動
https://blog.csdn.net/bcfdsagbfcisbg/article/details/80250095

sudo bundle exec rails server webrick -e production

==================================================

Email 收信
https://rickhw.github.io/2019/05/29/Redmine/How-to-Receiving-Email-using-IMAP/

rake -f ${RAKEFILE} redmine:email:receive_imap \
    RAILS_ENV=production \
    host=${IMAP_HOST} port=993 ssl=true \
    username=${USERNAME} \
    password=${PASSWORD} \
    folder=Inbox \
    --trace

RedmineReceivingEmails
https://www.redmine.org/projects/redmine/wiki/RedmineReceivingEmails

Email 通知
https://blog.longwin.com.tw/2011/03/redmine-email-auto-notify-2011/
https://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/637175/

2019年7月26日 星期五

Android S3 SDK Download File sample code (Download file 到你的手機下載資料夾) (Android的一百種奇技淫巧)

沒用過AWS 下載,方式蠻多,研究了一陣子,記錄分享。

public class MainActivity extends AppCompatActivity {

    @Override    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);        setContentView(R.layout.activity_main);        String awsAccessKey = "Your-awsAccessKey";        String awsSecretKey = "Your-awsSecretKey";        String sessionToken = "Your-sessionToken";
        AWSSessionCredentials awsCred = new BasicSessionCredentials(awsAccessKey
                , awsSecretKey, sessionToken);
        String fileKey = "Your-fileKey";        downloadWithTransferUtility(fileKey, awsCred);    }

    private void downloadWithTransferUtility(String fileKey, AWSSessionCredentials awsCred) {
        TransferNetworkLossHandler.getInstance(getApplicationContext());        AmazonS3Client s3Client = new AmazonS3Client(awsCred, Region.getRegion(Regions.AP_NORTHEAST_1), new ClientConfiguration());
        TransferUtility transferUtility =
                TransferUtility.builder()
                        .context(getApplicationContext())
                        .awsConfiguration(AWSMobileClient.getInstance().getConfiguration())
                        .s3Client(s3Client)
                        .defaultBucket("Your-BucketName")
                        .build();
        String fileName = getDownloadFileName(fileKey);        TransferObserver downloadObserver =
                transferUtility.download(fileKey,                        new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + fileName));
        // Attach a listener to the observer to get state update and progress notifications        downloadObserver.setTransferListener(new TransferListener() {
            @Override            public void onStateChanged(int id, TransferState state) {
                if (TransferState.COMPLETED == state) {
                    // Handle a completed upload.                    Toast.makeText(MainActivity.this, "TransferState.COMPLETED", Toast.LENGTH_SHORT).show();                }
            }

            @Override            public void onProgressChanged(int id, long bytesCurrent, long bytesTotal) {
                float percentDonef = ((float) bytesCurrent / (float) bytesTotal) * 100;                int percentDone = (int) percentDonef;                Log.d("Your Activity", "   ID:" + id + "   bytesCurrent: " + bytesCurrent + "   bytesTotal: " + bytesTotal + " " + percentDone + "%");            }

            @Override            public void onError(int id, Exception ex) {
                // Handle errors            }
        });    }

    public String getDownloadFileName(String key) {
        String[] path_split = key.split("/");        return path_split[path_split.length - 1];    }
}

2018年8月23日 星期四