2019년 11월 21일 목요일

MX Linux(Debian 계열)에서 Spotify로 음악 듣기

Listening to Music with Spotify in MX Linux 

(if you're traveling a spotify-unsupported country)

우리나라에서는 아직(?) Spotify가 서비스 되지 않고 막혀 있기 때문에, Spotify가 사용자의 컴퓨터가 한국에 있다는 걸 알지 못하도록 VPN을 사용해야 한다.
또한 검색결과 최근(2019년 11월) 리눅스에서 가장 핫한 VPN은 Windscribe라고 한다.

Windscribe에 가입하여 아이디와 비번을 받는다. 이메일 인증을 완료해야 월 10GB가 무료다. 이메일 인증을 안 하면 월 2GB.
(링크: https://kor.windscribe.com/)

VPN을 사용하기 위한 패키지를 설치한다.
(참조링크: https://kor.windscribe.com/guides/manual_ubuntu)

sudo apt-get install network-manager-vpnc 
sudo apt-get install openvpn network-manager-openvpn network-manager-openvpn-gnome 
sudo /etc/init.d/networking restart 

이제 Windscribe VPN 클라이언트를 설치한다.(참조링크: https://kor.windscribe.com/guides/linux)

sudo apt-get install dirmngr apt-transport-https
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key FDC247B7

sudo sh -c "echo 'deb https://repo.windscribe.com/debian buster main' > /etc/apt/sources.list.d/windscribe-repo.list"
sudo apt-get update
sudo apt-get install windscribe-cli
windscribe login
windscribe connect


그럼 VPN 연결은 홍콩에 있는 서버로 연결이 된다.

그리고 Spotify를 설치할 차례,
(참조링크: https://www.spotify.com/int/download/linux/)

curl -sS https://download.spotify.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list
sudo apt-get update && sudo apt-get install spotify-client

GUI에서 Spotify를 실행하고, 계정을 만든다.

VPN을 통한 스트리밍 속도가 느려서 그런지 음악 재생이 잘 안 되기 때문에, 이후 Spotify에 로그인 할 때만 VPN에 연결하고

sudo windscribe disconnect

연결을 종료한 후에 재생을 하면 끊김없이 들을 수 있다.


2019년 10월 18일 금요일

Post-navigation links for the same category in Wordpress (게시글의 이전/다음 링크가 같은 카테고리로만 보이게 하기, 워드프레스)

In single.php, after content code

get_template_part( 'template-parts/post/content', get_post_format() ); //  content code

there is the code for post navigation (means links to move between this and that posts)

the_post_navigation(
  array(
    'prev_text' => '...' . '...',
    'next_text' => '...' . '...',
  )
);

it shows two links for the previous post and next one of the current post at the bottom of the screen,
however, the problem is when you click/tab the links again and gain, you find the links include any posts from all different categories, just in order of their written date and time.

Here is the way to move among only one category, even though you keep clicking/tabbing the prev/next links.

the_post_navigation(
  array(
    'prev_text' => '...' . '...',
    'next_text' => '...' . '...',
    'in_same_term' => true,
    'taxonomy' => 'category',
  )
);

Yup, adding that two lines are all.
Happy wordpressing!

2019년 7월 31일 수요일

Chrome: How to prevent Chrome open pdf / Open pdf with your pdf viewer in Chrome downloads list

Chrome ver. 79.x.xxx

  • chrome:settings
  • Search 'pdf' in the box
  • Click 'Site Settings'
  • Click 'PDF documents' near the bottom
  • Enable 'Download PDF files instead of automatically opening them in Chrome'


No option of 'Click to open embedded PDFs' in the current version (79.0.3945.130)

Google Chrome

How to prevent Chrome open pdf / Opening pdf with your pdf viewer in Chrome downloads list

  1. Type 'about:flags' in the address bar
  2. Type 'pdf' in Search flags box
  3. Find 'Click to open embedded PDFs' (it's at the top with ver. 75.0.3770.142.)
  4. Change 'Default' menu to 'Disabled'
  5. Click 'Relaunch' button (caution: you might lose all open sites/tabs unless it's set up as 'Continue where you left off' in 'On startup' category of Settings.)

Hooray!


구글 크롬

크롬에서 pdf 파일 열리는 걸 방지하는 방법 / 크롬 다운로드 리스트에서 pdf 클릭해도 내 기본 pdf 뷰어에서 열리도록 하기

  1. 주소창에 'about:flags' 입력
  2. Flag 검색창에 'pdf' 입력
  3. 'Click to open embedded PDFs' 항목 찾기 (ver. 75.0.3770.142에서 맨 위로 검색됨)
  4. '기본값'을 '비활성'으로 바꿈
  5. '재실행' 버튼 눌러서 크롬 재시작 (경고: 열려있는 모든 탭/사이트를 잃을 수도 있음, 설정에서 '지난 번 탭 유지'가 되어 있지 않으면.)

어예!

2019년 7월 9일 화요일

Customizing Windows 7 for a Happier Life

For more PRODUCTIVE MS Windows

MS Windows 7 is a weak OS and I've never thought it's user-friendly because a user should touch many miscellaneous parts to make it usable or productive.

This article is about some tips including how to bring my apps or windows back onto the screen automatically after restart of Windows 7 for higher productivity.

Open 'My Computer', not Libraries when Windows Explorer clicked

  1. Right click on the icon of Taskbar
  2. Right click again on the small Windows Explorer icon
  3. Properties
  4. Type at the end of the Target textbox content, ' shell:MyComputerFolder', without the small quotation marks, including the space at the beginning.

 

Bring opened Windows Explorer windows back after restart

  1. Go to Folder Options (via Control Panel, for instance)
  2. View tab at top
  3. Scroll down in 'Advanced settings:' area
  4. Check 'Restore previous folder windows at logon
  5. Don't close any Windows Explorers when shutdown/restart

 

Bring your always-used apps back after restart

  1. Click Start button
  2. Type 'shell:startup'
  3. Drag & drop (making shortcuts) any program you want from Start Menu or from the application's folder (for example, C:\Program Files\Sublime Text 3)
  4. If possible, make the app's settings as it opens/recover all opened files/tabs (for example, set up your Chrome/Firefox to open all tabs back when it starts)

 

Typing Tips after Start button

  1. shell:appdata to open hidden Appdata folder
  2. shell:startup to open Startup Programs folder
  3. shell:programfiles to open C:/Program Files folder
  4. appwiz.cpl to open Programs and Features dialogue



2019년 7월 3일 수요일

Grunt (sass, jshint, concat, uglify, watch)

Gruntfile.js

module.exports = function( grunt ) {
var dir_theme = 'wp-content/themes/2017-child/',
dir_js =    'wp-content/themes/2017-child/assets/js/';

grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
concat: {
// options: {
// separator: ';'
// },
dist: {
src: [dir_js + 'src/**/*.js',
'!' + dir_js + 'src/*-long.js',
'!' + dir_js + 'src/concatenated.js'],
dest: dir_js + 'src/concatenated.js'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */'
},
dist: {
src: // 'style.css': ['style.scss', '<%= concat.dist.dest %>'],
['<%= concat.dist.dest %>'],
dest: 
dir_js + '<%= pkg.name %>.js'
}
},
// qunit: {
// files: ['bl-page-content/**/*.html']
// },
jshint: {
files: [dir_js + 'src/**/*.js',
dir_js + 'global.js',
'!<%= concat.dist.dest %>'],
options: {
// verbose: true,
'-W004': true,
'-W030': true,
esversion: 6,
globals: {
jQuery: true,
console: true,
module: true,
// document: true
}
}
},
sass: {
options: {
sourceMap: true
},
dist: {
src: dir_theme + 'style.scss',
dest: dir_theme + 'style.css'
}
},
watch: {
sass: {
files: dir_theme + 'style.scss',
tasks: ['sass']
},
jshint: {
files: ['<%= jshint.files %>'],
tasks: ['jshint']
}
}
});

grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
// grunt.loadNpmTasks( 'grunt-contrib-qunit' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-contrib-concat' );
grunt.loadNpmTasks( 'grunt-contrib-sass' );

// grunt.registerTask( 'test', ['jshint', 'qunit']);
// grunt.registerTask( 'default', ['sass', 'jshint', 'qunit', 'concat', 'uglify']);
grunt.registerTask( 'js', ['jshint']);
grunt.registerTask( 'default', ['sass', 'jshint', 'concat', 'uglify']);
grunt.registerTask( 'cu', ['concat', 'uglify']);
};


2019년 4월 22일 월요일

Git and Github

$git init

$ssh-keygen

$ssh-add ~/.ssh/id_rsa

$git remote add origin SSH_URL_FROM_GITHUB



Set a ssh config file

$cat > ~/.ssh/config
Host github.com
  Hostname github.com
  AddKeysToAgent yes
  IdentityFile ~/.ssh/id_rsa

(CTRL+D)



Set a basic path

$cat >> ~/.bash_profile
alias la='ls -a'
alias ll='ls -l'
HOME=/d/webhome/

HOMEDRIVE=D:/
HOMEPATH=\webhome

cd
(CTRL+D)

Avoiding ssh passphrase prompt

$cat >> ~/.bash_profile
eval `ssh-agent -s`
ssh-add ~/.ssh/*_rsa
(CTRL+D)


 
Patterned upload

$git checkout -b BRANCH_NAME

(coding)

$git status

$git diff FILENAME

$git add FILENAME

$git commit- m "COMMIT MSG FOR THE FILE"

$git push

(testing)

$git checkout master

$git merge BRANCH_NAME

(if needed)

$git branch -d BRANCH_NAME_TO_DELETE



Check commit id
$git log

Create a temporary branch to check old code
$ git checkout -b <temp_branch_name> <commit_id>

Going back to the current/final version
$ git checkout master

Rename a branch
$ git checkout BRANCH
$ git branch -m NEW_NAME

Cancel 'add'
$ git reset FILENAME

Check difference of an added file
$ git diff --cache FILENAME

Xubuntu: Installing a Printer (Canon G3060 PIXMA)

$ sudo apt install system-config-printer Download the proper driver for linux from Canon website. Turn on the printer and set up its WiFi. C...